@@ -23,19 +23,40 @@ jobs:
2323 # 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
2928 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' }}
29+ is_release_master : ${{ needs.context.outputs.is_release_master }}
30+ event : ${{ github.event_name }}
31+ conclusion : ${{ github.event.workflow_run.conclusion }}
32+ emoji : ${{ env.conclusion == 'success' && ':white_check_mark:' || ':x:' }}
33+ workflow_id : ${{ github.event.workflow_run.id }}
34+ workflow_url : ${{ github.event.workflow_run.url }}
35+ text_template : ' {1} {2} completed with {3}'
36+ retry_template : ' [Rerun Workflow]({1})'
37+ workflow_template : ' :github: *Workflow Run:* [{1}]({2})'
38+ triggered_template : ' :bust_in_silhouette: *Triggered by:* @{1}'
39+
3240 with :
3341 slack_token : ${{ secrets.SLACK_TOKEN }}
3442 method : chat.postMessage
3543 payload : |
3644 channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
45+ text: ${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}
3746 blocks:
3847 - type: context
3948 elements:
4049 - type: mrkdwn
41- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
50+ text: ${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}
51+ - type: mrkdwn
52+ text: ${{ format(env.workflow_template, env.workflow_id, env.workflow_url) }}
53+ - type: mrkdwn
54+ text: ${{ format(env.triggered_template, github.actor) }}
55+ # ${{ github.event.workflow_run.conclusion == 'failure' && format('
56+ # - type: section
57+ # text:
58+ # type: mrkdwn
59+ # text: ${{ format(env.retry_template, github.event.workflow_run.rerun_url) }}
60+ # ')}}
61+
62+
0 commit comments