@@ -20,22 +20,35 @@ 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+
3233 with :
3334 slack_token : ${{ secrets.SLACK_TOKEN }}
3435 method : chat.postMessage
3536 payload : |
36- channel: ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
37+ channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
38+ text: "${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}"
3739 blocks:
3840 - type: context
3941 elements:
4042 - type: mrkdwn
41- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
43+ text: "${{ format(env.text_template, env.emoji, env.event, env.conclusion) }}"
44+ - type: mrkdwn
45+ text: "*Actor:* ${{ github.actor }}"
46+ - type: mrkdwn
47+ text: "*Commit:* ${{ github.event.workflow_run.head_commit.id }}"
48+ - type: mrkdwn
49+ text: "[Rerun Workflow](${{ github.event.workflow_run.rerun_url }})"
50+ - type: mrkdwn
51+ text: "[View Workflow](${{ github.event.workflow.url }})"
52+
53+
54+
0 commit comments