@@ -16,26 +16,54 @@ 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+
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: "${{ env.event }} completed with ${{ env.conclusion }}"
3740 blocks:
38- - type: context
39- elements:
40- - type: mrkdwn
41- text: ":github: *Workflow Run:* ${{ github.event.workflow_run.url }}"
41+ - type: section
42+ text:
43+ type: mrkdwn
44+ text: "${{ env.emoji }} *${{ env.event }}* completed with ${{ env.conclusion }}"
45+ accessory:
46+ type: button
47+ text:
48+ type: plain_text
49+ text: "View Workflow"
50+ url: ${{ github.event.workflow.url }}
51+ # - type: section
52+ # text:
53+ # type: mrkdwn
54+ # text: "*Actor:* ${{ github.actor }}"
55+ # - type: section
56+ # text:
57+ # type: mrkdwn
58+ # text: "*Commit:* ${{ github.event.workflow_run.head_commit.id }}"
59+ # - type: section
60+ # text:
61+ # type: mrkdwn
62+ # text: "[Rerun Workflow](${{ github.event.workflow_run.rerun_url }})"
63+ # - type: section
64+ # text:
65+ # type: mrkdwn
66+ # text: "[View Workflow](${{ github.event.workflow.url }})"
67+
68+
69+
0 commit comments