diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7eb05de8a26..66e254f22cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -422,3 +422,31 @@ jobs: - uses: SonarSource/ci-github-actions/promote@v1 with: promote-pull-request: true + + notify-build-failure: + name: Notify Build Failure + needs: + - build + - ruling-qa + - plugin-qa + - sanity + - test-analyze + - custom-rules-license-check + - qa-os-win + - 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: sonar-xs-public + permissions: + actions: read # lets the action list this run's own jobs via the GitHub API + 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 }}