@@ -16,26 +16,52 @@ jobs:
1616
1717 steps :
1818 - uses : actions/checkout@v4
19+ - uses : ./.github/actions/context
1920
2021 notify_slack :
2122 runs-on : ubuntu-latest
2223 needs : [context]
23- # Only notify slack on release events
2424 if : ${{ needs.context.outputs.is_release_master || needs.context.outputs.is_release_tag }}
2525 steps :
26- - uses : actions/checkout@v4
2726 - name : Notify Slack
28- uses : ./.github/actions/slack
27+ uses : mozilla/addons/.github/actions/slack@main
28+
2929 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+ rerun_url : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/rerun
35+
3236 with :
3337 slack_token : ${{ secrets.SLACK_TOKEN }}
3438 method : chat.postMessage
3539 payload : |
36- channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
40+ channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
41+ text: "${{ env.event }} completed with ${{ env.conclusion }}"
3742 blocks:
38- - type: context
39- elements:
40- - type: mrkdwn
41- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
43+ - type: context
44+ elements:
45+ - type: mrkdwn
46+ text: "*Commit:* ${{ github.event.workflow_run.head_commit.id }}"
47+ - type: mrkdwn
48+ text: "*Event:* ${{ env.event }}"
49+ - type: mrkdwn
50+ text: "*Conclusion:* ${{ env.conclusion }}"
51+ - type: actions
52+ elements:
53+ - type: button
54+ text:
55+ type: plain_text
56+ text: "View Workflow"
57+ emoji: true
58+ value: workflow_url
59+ url: ${{ env.workflow_url }}
60+ - type: button
61+ text:
62+ type: plain_text
63+ text: "Rerun Workflow"
64+ emoji: true
65+ value: rerun_url
66+ url: ${{ env.rerun_url }}
67+
0 commit comments