Skip to content

Commit cf5daf0

Browse files
jonas-wielage-sonarsourcesonartech
authored andcommitted
SONARIAC-2429 Fix slack notification for public and private builds (#679)
GitOrigin-RevId: cb2d5c81f23ebfc5e0860768eda5fd2ed7c7b5f2
1 parent 7fef5e2 commit cf5daf0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,23 @@ jobs:
7171
use-develocity: true
7272
gradle-args: --build-cache -x artifactoryPublish -Dsonar.projectName=SonarIaC
7373
disable-caching: true
74+
75+
notify_slack:
76+
name: Notify Slack on Failure
77+
needs: [ build ]
78+
if: >-
79+
!cancelled() && failure() &&
80+
(github.ref_name == github.event.repository.default_branch ||
81+
startsWith(github.ref_name, 'branch-') ||
82+
startsWith(github.ref_name, 'feature/'))
83+
permissions:
84+
id-token: write
85+
statuses: read
86+
runs-on: github-ubuntu-latest-s
87+
steps:
88+
- uses: SonarSource/release-github-actions/notify-slack@v1
89+
with:
90+
project-name: "SonarIaC - Public"
91+
slack-channel: "squad-security-cloud-notifs"
92+
icon: ':face_in_clouds:'
93+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)