@@ -10,54 +10,46 @@ jobs:
1010 context :
1111 runs-on : ubuntu-latest
1212
13- outputs :
14- is_release_master : true
15- is_release_tag : true
16-
1713 steps :
1814 - uses : actions/checkout@v4
1915 - uses : ./.github/actions/context
2016
21- notify_slack :
17+ slack_notification :
18+ needs : context
19+ strategy :
20+ matrix :
21+ include :
22+ - actor : ${{ github.event.workflow_run.actor.login }}
23+ event : ' push'
24+ conclusion : ' success'
25+ env : ' dev'
26+ ref : ${{ github.event.workflow_run.head_commit.id }}
27+ - actor : ${{ github.event.workflow_run.actor.login }}
28+ event : ' push'
29+ conclusion : ' failure'
30+ env : ' dev'
31+ ref : ${{ github.event.workflow_run.head_commit.id }}
32+ - actor : ${{ github.event.workflow_run.actor.login }}
33+ event : ' release'
34+ conclusion : ' success'
35+ env : ' production'
36+ ref : 2025.01.01
37+ - actor : ${{ github.event.workflow_run.actor.login }}
38+ event : ' release'
39+ conclusion : ' failure'
40+ env : ' production'
41+ ref : 2025.01.01
42+
2243 runs-on : ubuntu-latest
23- needs : [context]
24- if : ${{ needs.context.outputs.is_release_master || needs.context.outputs.is_release_tag }}
2544 steps :
26- - name : Notify Slack
27- uses : mozilla/addons/.github/actions/slack@main
28-
29- env :
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 }}
45+ - uses : actions/checkout@v4
46+ - uses : ./.github/actions/slack-workflow-notification
3547 with :
3648 slack_token : ${{ secrets.SLACK_TOKEN }}
37- method : chat.postMessage
38- payload : |
39- channel: "${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}"
40- text: "${{ env.event }} completed with ${{ env.conclusion }}"
41- blocks:
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-
49+ slack_channel : ${{ secrets.SLACK_ADDONS_PRODUCTION_CHANNEL }}
50+ actor : ${{ matrix.actor }}
51+ event : ${{ matrix.event }}
52+ conclusion : ${{ matrix.conclusion }}
53+ env : ${{ matrix.env }}
54+ ref : ${{ matrix.ref }}
55+ workflow_id : ${{ github.event.workflow_run.id }}
0 commit comments