Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Comment on lines +57 to +63

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [cross-pr] Notifier misses scan-job failures once PR #138's scan job merges

This PR (#140, head f3c38f7) adds notify-build-failure with needs: [build, promote] and fires only when contains(needs.*.result, 'failure'). Open PR #138 (head 442e133) moves the Sonar analysis into a new scan job and makes promote depend on [build, scan]. Its description says it keeps "promotion and releasability gated by the scan". needs.*.result only covers jobs listed directly in needs. If scan fails, build is success and promote is skipped, because a dependency failed and it has no always(). Neither result is failure, so the Slack notification is silently skipped for analysis failures on master, branch-* and dogfood-*. This only happens if both PRs merge into master, in either order, and the notifier's needs list is not updated to include scan when the build.yml conflict is resolved. If only one PR merges, the gap does not appear.

Was this helpful? React with 👍 / 👎

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 }}
Loading