diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 774a271..40104dc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,3 +51,25 @@ jobs: - uses: SonarSource/ci-github-actions/promote@v1 with: promote-pull-request: true + + notify-build-failure: + name: Notify build failure + needs: + - build + - promote + if: >- + always() + && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/branch-') || startsWith(github.ref, 'refs/heads/dogfood-')) + && contains(needs.*.result, 'failure') + runs-on: github-ubuntu-latest-s # Public repo - use custom GitHub-hosted runner + permissions: + actions: read + id-token: write # required for vault-action-wrapper in the shared slack-notify action + steps: + - name: Slack Notification + uses: SonarSource/core-languages-tooling-public/common-actions/slack-notify@v1 + with: + slack-channel: squad-corelang-notifs + branch-patterns: ${{ format('{0},branch-*,dogfood-*', github.event.repository.default_branch) }} + github-token: ${{ github.token }} + branch: ${{ github.ref_name }}