@@ -20,22 +20,35 @@ jobs:
20
20
notify_slack :
21
21
runs-on : ubuntu-latest
22
22
needs : [context]
23
- # Only notify slack on release events
24
23
if : ${{ needs.context.outputs.is_release_master || needs.context.outputs.is_release_tag }}
25
24
steps :
26
- - uses : actions/checkout@v4
27
25
- name : Notify Slack
28
- uses : ./ .github/actions/slack
26
+ uses : mozilla/addons/ .github/actions/slack@main
29
27
env :
30
- retry_text : ' [Rerun Workflow](${{ github.event.workflow_run.rerun_url }})'
31
- event_text : ${{ needs.context.outputs.is_release_master && 'Release Master' || 'Release Tag' }}
28
+ event : ${{ github.event_name }}
29
+ conclusion : ${{ github.event.workflow_run.conclusion }}
30
+ emoji : ${{ env.conclusion == 'success' && ':white_check_mark:' || ':x:' }}
31
+ text_template : ' {0} {1} completed with {2}'
32
+
32
33
with :
33
34
slack_token : ${{ secrets.SLACK_TOKEN }}
34
35
method : chat.postMessage
35
36
payload : |
36
- channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
37
+ channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
38
+ text: "${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}"
37
39
blocks:
38
40
- type: context
39
41
elements:
40
42
- type: mrkdwn
41
- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
43
+ text: "${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}"
44
+ - type: mrkdwn
45
+ text: "*Actor:* ${{ github.actor }}"
46
+ - type: mrkdwn
47
+ text: "*Commit:* ${{ github.event.workflow_run.head_commit.id }}"
48
+ - type: mrkdwn
49
+ text: "[Rerun Workflow](${{ github.event.workflow_run.rerun_url }})"
50
+ - type: mrkdwn
51
+ text: "[View Workflow](${{ github.event.workflow.url }})"
52
+
53
+
54
+
0 commit comments