@@ -2,7 +2,7 @@ name: Default (completed)
2
2
3
3
on :
4
4
workflow_run :
5
- workflows : ' Default'
5
+ workflows : [ 'Default', 'Release']
6
6
types :
7
7
- completed
8
8
@@ -16,26 +16,48 @@ jobs:
16
16
17
17
steps :
18
18
- uses : actions/checkout@v4
19
+ - uses : ./.github/actions/context
19
20
20
21
notify_slack :
21
22
runs-on : ubuntu-latest
22
23
needs : [context]
23
- # Only notify slack on release events
24
24
if : ${{ needs.context.outputs.is_release_master || needs.context.outputs.is_release_tag }}
25
25
steps :
26
- - uses : actions/checkout@v4
27
26
- name : Notify Slack
28
- uses : ./.github/actions/slack
27
+ uses : mozilla/addons/.github/actions/slack@main
28
+
29
29
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' }}
30
+ event : ${{ github.event.workflow_run.event }}
31
+ conclusion : ${{ github.event.workflow_run.conclusion }}
32
+ emoji : ${{ github.event.workflow_run.conclusion == 'success' && ':white_check_mark:' || ':x:' }}
33
+ workflow_url : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}
34
+ workflow_id : ${{ github.event.workflow_run.id }}
32
35
with :
33
36
slack_token : ${{ secrets.SLACK_TOKEN }}
34
37
method : chat.postMessage
35
38
payload : |
36
- channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
39
+ channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
40
+ text: "${{ env.event }} completed with ${{ env.conclusion }}"
37
41
blocks:
38
- - type: context
39
- elements:
40
- - type: mrkdwn
41
- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
42
+ - type: section
43
+ text:
44
+ type: mrkdwn
45
+ text: "${{ env.emoji }} *${{ env.event }}* completed with *${{ env.conclusion }}*"
46
+ - type: context
47
+ elements:
48
+ - type: mrkdwn
49
+ text: "*Workflow:* ${{ env.workflow_id }}"
50
+ - type: mrkdwn
51
+ text: "*Actor:* ${{ github.event.workflow_run.actor.login }}"
52
+ - type: mrkdwn
53
+ text: "*Commit:* ${{ github.event.workflow_run.head_commit.id }}"
54
+ - type: actions
55
+ elements:
56
+ - type: button
57
+ text:
58
+ type: plain_text
59
+ text: "View Workflow"
60
+ emoji: true
61
+ value: workflow_url
62
+ url: ${{ env.workflow_url }}
63
+
0 commit comments