11name : Tests
22on :
3- pull_request_target :
3+ pull_request_target : # zizmor: ignore[dangerous-triggers]
44 push :
55 branches :
66 - main
@@ -15,13 +15,13 @@ jobs:
1515 checks : write
1616 steps :
1717 - name : " build: checkout the latest changes"
18- uses : actions/checkout@v4
18+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1919 with :
2020 persist-credentials : false
2121 ref : ${{ github.event.pull_request.head.sha }}
2222
2323 - name : " build: setup the node runtime"
24- uses : actions/setup-node@v4
24+ uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2525 with :
2626 cache : npm
2727 cache-dependency-path : package-lock.json
4040 run : npm test
4141
4242 - name : " unit(test): upload coverage to CodeCov"
43- 43+ uses : codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
4444 with :
4545 directory : ./coverage
4646 token : ${{ secrets.CODECOV_TOKEN }}
@@ -50,15 +50,19 @@ jobs:
5050
5151 - name : " pretest(inputs): save the push event trigger commit URL"
5252 if : " contains(github.event_name, 'push')"
53+ id : push
5354 run : |
54- url=${{ github.event.head_commit.url }}
55- echo "EVENT_URL=$url" >> "$GITHUB_ENV"
55+ echo "url=$URL" >> "$GITHUB_OUTPUT"
56+ env :
57+ URL : ${{ github.event.head_commit.url }}
5658
5759 - name : " pretest(inputs): save the pull request event trigger commit URL"
5860 if : " contains(github.event_name, 'pull_request')"
61+ id : pull_request
5962 run : |
60- url=${{ github.event.pull_request.html_url }}
61- echo "EVENT_URL=$url" >> "$GITHUB_ENV"
63+ echo "url=$URL" >> "$GITHUB_OUTPUT"
64+ env :
65+ URL : ${{ github.event.pull_request.html_url }}
6266
6367 - name : " integration(wfb): send a payload to workflow builder via webhook trigger"
6468 id : wfb
@@ -70,12 +74,14 @@ jobs:
7074 payload : |
7175 author: ${{ github.event.sender.login }}
7276 channel_id: ${{ secrets.SLACK_CHANNEL_ID }}
73- event_url: ${{ env.EVENT_URL }}
77+ event_url: ${{ steps.push.outputs.url || steps.pull_request.outputs.url }}
7478 repo_name: ${{ github.event.repository.full_name }}
7579 status: ${{ job.status }}
7680
7781 - name : " integration(wfb): confirm a payload was sent"
78- run : test -n "${{ steps.wfb.outputs.time }}"
82+ run : test -n "$WFB_OUTPUT_TIME"
83+ env :
84+ WFB_OUTPUT_TIME : ${{ steps.wfb.outputs.time }}
7985
8086 - name : " integration(botToken): post a message to channel"
8187 id : message
8995 text: ":checkered_flag: Action happens at <https://github.com/${{ github.repository }}>"
9096
9197 - name : " integration(method): confirm a message was posted"
92- run : test -n "${{ steps.message.outputs.ts }}"
98+ run : test -n "$MESSAGE_OUTPUT_TS"
99+ env :
100+ MESSAGE_OUTPUT_TS : ${{ steps.message.outputs.ts }}
93101
94102 - name : " integration(method): post a message with blocks"
95103 id : blocks
@@ -109,7 +117,9 @@ jobs:
109117 value: "Processing"
110118
111119 - name : " integration(method): confirm the blocks were posted"
112- run : test -n "${{ steps.blocks.outputs.ts }}"
120+ run : test -n "$BLOCKS_OUTPUT_TS"
121+ env :
122+ BLOCKS_OUTPUT_TS : ${{ steps.blocks.outputs.ts }}
113123
114124 - name : " integration(method): post a threaded message"
115125 id : timer
@@ -124,7 +134,9 @@ jobs:
124134 thread_ts: "${{ steps.blocks.outputs.ts }}"
125135
126136 - name : " integration(incoming): confirm the thread started"
127- run : test -n "${{ steps.timer.outputs.time }}"
137+ run : test -n "$TIMER_OUTPUT_TIME"
138+ env :
139+ TIMER_OUTPUT_TIME : ${{ steps.timer.outputs.time }}
128140
129141 - name : " integration(method): wait to mock event processing"
130142 run : sleep 3
@@ -184,7 +196,9 @@ jobs:
184196 name: "tada"
185197
186198 - name : " integration(method): confirm the thread ended"
187- run : test -n "${{ steps.done.outputs.time }}"
199+ run : test -n "$DONE_OUTPUT_TIME"
200+ env :
201+ DONE_OUTPUT_TIME : ${{ steps.done.outputs.time }}
188202
189203 - name : " integration(incoming): post a message via incoming webhook"
190204 id : incoming
@@ -203,10 +217,12 @@ jobs:
203217 emoji: true
204218
205219 - name : " integration(incoming): confirm a webhook was posted"
206- run : test -n "${{ steps.incoming.outputs.time }}"
220+ run : test -n "$INCOMING_WEBHOOK_OUTPUT_TIME"
221+ env :
222+ INCOMING_WEBHOOK_OUTPUT_TIME : ${{ steps.incoming.outputs.time }}
207223
208224 - name : " integration(incoming): reveal contents of the github payload"
209- run : echo $JSON
225+ run : echo " $JSON"
210226 env :
211227 JSON : ${{ toJSON(github) }}
212228
@@ -224,10 +240,12 @@ jobs:
224240 ATTACHMENT_COLOR : ${{ (job.status == 'success' && 'good') || (job.status == 'failure' && 'danger') || 'warning' }}
225241
226242 - name : " integration(incoming): confirm a payload file was posted"
227- run : test -n "${{ steps.payload_file.outputs.time }}"
243+ run : test -n "$PAYLOAD_FILE_OUTPUT_TIME"
244+ env :
245+ PAYLOAD_FILE_OUTPUT_TIME : ${{ steps.payload_file.outputs.time }}
228246
229247 - name : " chore(health): check up on recent changes to the health score"
230- 248+ uses : slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
231249 with :
232250 codecov_token : ${{ secrets.CODECOV_API_TOKEN }}
233251 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments