Skip to content

Commit fdcb776

Browse files
author
Angelo Buono
authored
Unify Slack notifications with GH action (#4832)
1 parent 52e64d0 commit fdcb776

3 files changed

Lines changed: 14 additions & 21 deletions

File tree

.github/workflows/dogfood.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ on:
1010
# branches:
1111
# - 'dogfood/**'
1212

13-
env:
14-
SLACK_CHANNEL: team-lang-java-notifs
15-
SLACK_USERNAME: Dogfood build action
16-
1713
jobs:
1814
dogfood_merge:
1915
runs-on: ubuntu-latest
@@ -38,19 +34,3 @@ jobs:
3834
# Use the output from the `dogfood` step
3935
- name: Get the name of the dogfood branch and its HEAD SHA1
4036
run: echo "The dogfood branch was `${{ steps.dogfood.outputs.dogfood-branch }}` and its HEAD SHA1 was `${{ steps.dogfood.outputs.sha1 }}`"
41-
#slack notifications
42-
- name: Notify success on Slack
43-
uses: Ilshidur/action-slack@1.6.2
44-
env:
45-
SLACK_WEBHOOK: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_WEBHOOK }}
46-
SLACK_OVERRIDE_MESSAGE: 'Dogfood build for `${{ steps.dogfood.outputs.sha1 }}`: *successful*'
47-
with:
48-
args: 'Succeed to build dogfood branch'
49-
- name: Notify failures on Slack
50-
uses: Ilshidur/action-slack@1.6.2
51-
if: failure()
52-
env:
53-
SLACK_WEBHOOK: ${{ fromJSON(steps.secrets.outputs.vault).SLACK_WEBHOOK }}
54-
SLACK_OVERRIDE_MESSAGE: 'Dogfood build for `${{ steps.dogfood.outputs.sha1 }}`: *failed*, see the logs at https://github.com/SonarSource/sonar-java/actions'
55-
with:
56-
args: 'Fail to build dogfood branch'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
with:
1717
publishToBinaries: true
1818
mavenCentralSync: true
19-
slackChannel: team-lang-java-notifs
19+
slackChannel: squad-jvm-notifs

.github/workflows/slack_notify.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Slack Notifications
3+
on:
4+
check_run:
5+
types: [rerequested, completed]
6+
7+
jobs:
8+
slack-notifications:
9+
permissions:
10+
id-token: write # to authenticate via OIDC
11+
uses: SonarSource/gh-action_build-notify/.github/workflows/main.yaml@v1
12+
with:
13+
slackChannel: squad-jvm-notifs

0 commit comments

Comments
 (0)