@@ -20,22 +20,47 @@ jobs:
2020 notify_slack :
2121 runs-on : ubuntu-latest
2222 needs : [context]
23- # Only notify slack on release events
2423 if : ${{ needs.context.outputs.is_release_master || needs.context.outputs.is_release_tag }}
2524 steps :
26- - uses : actions/checkout@v4
2725 - name : Notify Slack
28- uses : ./ .github/actions/slack
26+ uses : mozilla/addons/ .github/actions/slack@main
2927 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+ triggered_template : ' :bust_in_silhouette: *Triggered by:* @{0}'
33+
3234 with :
3335 slack_token : ${{ secrets.SLACK_TOKEN }}
3436 method : chat.postMessage
3537 payload : |
36- channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
38+ channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
39+ text: "${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}"
3740 blocks:
3841 - type: context
3942 elements:
4043 - type: mrkdwn
41- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
44+ text: "${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}"
45+ - type: mrkdwn
46+ text: "${{ format(env.triggered_template, github.actor) }}"
47+ - type: plain_text
48+ text: "Commit: ${{ github.event.workflow_run.head_commit.id }}"
49+
50+ - type: actions
51+ elements:
52+ - type: button
53+ text:
54+ type: plain_text
55+ text: "Rerun Workflow"
56+ value: ${{ github.event.workflow_run.rerun_url }}
57+ action_id: rerun_workflow
58+ - type: button
59+ text:
60+ type: mrkdwn
61+ text: ":github: *Workflow* ${{ github.event.workflow.id }}"
62+ value: ${{ github.event.workflow.url }}
63+ action_id: workflow_url
64+
65+
66+
0 commit comments