diff --git a/.github/workflows/buildDebug.yml b/.github/workflows/buildDebug.yml index be888a0..aa39425 100644 --- a/.github/workflows/buildDebug.yml +++ b/.github/workflows/buildDebug.yml @@ -47,28 +47,5 @@ jobs: notify: needs: build - runs-on: ubuntu-latest - steps: - - name: Send notification on Slack - uses: rtCamp/action-slack-notify@v2.2.0 - if: ${{ success() }} - env: - SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }} - SLACK_COLOR: ${{ job.status }} - SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_ICON_URL }} - SLACK_MESSAGE: ':white_check_mark: Build successful! :rocket:' - SLACK_TITLE: Kmplate-lib build status - SLACK_USERNAME: Github Actions CI - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} - - - name: Send notification on Slack - uses: rtCamp/action-slack-notify@v2.2.0 - if: ${{ failure() }} - env: - SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }} - SLACK_COLOR: ${{ job.status }} - SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_ICON_URL }} - SLACK_MESSAGE: ':x: Build failed! :pensive:' - SLACK_TITLE: Kmplate-lib build status - SLACK_USERNAME: Github Actions CI - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + uses: ./.github/workflows/notify.yml + secrets: inherit diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 0000000..5873185 --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,35 @@ +name: Notify build status on Slack + +on: + workflow_call: + secrets: + SLACK_WEBHOOK_URL: + required: true + +jobs: + notify: + runs-on: ubuntu-latest + steps: + - name: Send notification on Slack + uses: rtCamp/action-slack-notify@v2.2.0 + if: ${{ success() }} + env: + SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }} + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_ICON_URL }} + SLACK_MESSAGE: ':white_check_mark: Build successful! :rocket:' + SLACK_TITLE: Kmplate-lib build status + SLACK_USERNAME: Github Actions CI + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + + - name: Send notification on Slack + uses: rtCamp/action-slack-notify@v2.2.0 + if: ${{ failure() }} + env: + SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }} + SLACK_COLOR: ${{ job.status }} + SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_ICON_URL }} + SLACK_MESSAGE: ':x: Build failed! :pensive:' + SLACK_TITLE: Kmplate-lib build status + SLACK_USERNAME: Github Actions CI + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}