5
5
MAINTAINERS : |
6
6
# GitHub user names to request reviews from in cases where PRs can't be managed automatically.
7
7
- per1234
8
- CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT : check-submissions-failed
8
+ CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX : check-submissions-failed-
9
9
ERROR_MESSAGE_PREFIX : " :x: **ERROR:** "
10
10
11
11
on :
@@ -114,7 +114,7 @@ jobs:
114
114
run : echo "::set-output name=head::$(jq -c .head.sha "${{ steps.configuration.outputs.path }}/${{ env.JSON_IDENTIFIER }}")"
115
115
116
116
- name : Upload diff file to workflow artifact
117
- uses : actions/upload-artifact@v3
117
+ uses : actions/upload-artifact@v4
118
118
with :
119
119
path : ${{ steps.configuration.outputs.path }}/${{ steps.configuration.outputs.filename }}
120
120
name : ${{ steps.configuration.outputs.artifact }}
@@ -144,13 +144,13 @@ jobs:
144
144
location : ${{ runner.temp }}
145
145
146
146
- name : Download diff
147
- uses : actions/download-artifact@v3
147
+ uses : actions/download-artifact@v4
148
148
with :
149
149
path : ${{ needs.diff.outputs.path }}
150
150
name : ${{ needs.diff.outputs.artifact }}
151
151
152
152
- name : Remove no longer needed artifact
153
- uses : geekyeggo/delete-artifact@v2
153
+ uses : geekyeggo/delete-artifact@v5
154
154
with :
155
155
name : ${{ needs.diff.outputs.artifact }}
156
156
@@ -376,16 +376,23 @@ jobs:
376
376
if : env.PASS == 'false'
377
377
run : touch ${{ env.FAIL_FLAG_PATH }} # Arbitrary file to provide content for the flag artifact
378
378
379
+ # Each workflow artifact must have a unique name. The job matrix doesn't provide a guaranteed unique string to use
380
+ # for a name so it is necessary to generate one.
381
+ - name : Generate unique artifact suffix
382
+ if : env.PASS == 'false'
383
+ run : |
384
+ echo "CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_SUFFIX=$(cat /proc/sys/kernel/random/uuid)" >> "$GITHUB_ENV"
385
+
379
386
# The value of a job matrix output is set by whichever job happened to run last, not of use for this application.
380
387
# So it's necessary to use an alternative means of indicating that at least one submission failed the checks.
381
388
- name : Upload failure flag artifact
382
389
if : env.PASS == 'false'
383
- uses : actions/upload-artifact@v3
390
+ uses : actions/upload-artifact@v4
384
391
with :
385
392
if-no-files-found : error
386
393
include-hidden-files : true
387
394
path : ${{ env.FAIL_FLAG_PATH }}
388
- name : ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT }}
395
+ name : ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX }}${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_SUFFIX }}
389
396
390
397
check-submissions-result :
391
398
needs : check-submissions
@@ -394,13 +401,22 @@ jobs:
394
401
outputs :
395
402
pass : ${{ steps.failure-flag-exists.outcome == 'failure' }}
396
403
404
+ env :
405
+ CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH : ${{ github.workspace }}/artifacts
406
+
397
407
steps :
408
+ - name : Download submission check failure flag artifacts
409
+ uses : actions/download-artifact@v4
410
+ with :
411
+ path : ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH }}
412
+ pattern : ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX }}*
413
+
398
414
- name : Check for existence of submission check failure flag artifact
399
415
id : failure-flag-exists
400
- uses : actions/download-artifact@v3
401
416
continue-on-error : true
402
- with :
403
- name : ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT }}
417
+ # actions/download-artifact does not create a folder per its `path` input if no artifacts match `pattern`.
418
+ run : |
419
+ test -d "${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH }}"
404
420
405
421
check-submissions-fail :
406
422
needs :
0 commit comments