@@ -2,7 +2,7 @@ name: Default (completed)
22
33on :
44 workflow_run :
5- workflows : ' Default'
5+ workflows : [ 'Default', 'Release']
66 types :
77 - completed
88
@@ -16,26 +16,48 @@ 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+ workflow_id : ${{ github.event.workflow_run.id }}
3235 with :
3336 slack_token : ${{ secrets.SLACK_TOKEN }}
3437 method : chat.postMessage
3538 payload : |
36- channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
39+ channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
40+ text: "${{ env.event }} completed with ${{ env.conclusion }}"
3741 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