Skip to content

Commit 649244a

Browse files
authored
Merge pull request #3750 from arduino/dependabot/github_actions/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4
2 parents d37435d + 5d935c3 commit 649244a

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

.github/workflows/manage-prs.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
MAINTAINERS: |
66
# GitHub user names to request reviews from in cases where PRs can't be managed automatically.
77
- per1234
8-
CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT: check-submissions-failed
8+
CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX: check-submissions-failed-
99
ERROR_MESSAGE_PREFIX: ":x: **ERROR:** "
1010

1111
on:
@@ -114,7 +114,7 @@ jobs:
114114
run: echo "::set-output name=head::$(jq -c .head.sha "${{ steps.configuration.outputs.path }}/${{ env.JSON_IDENTIFIER }}")"
115115

116116
- name: Upload diff file to workflow artifact
117-
uses: actions/upload-artifact@v3
117+
uses: actions/upload-artifact@v4
118118
with:
119119
path: ${{ steps.configuration.outputs.path }}/${{ steps.configuration.outputs.filename }}
120120
name: ${{ steps.configuration.outputs.artifact }}
@@ -144,13 +144,13 @@ jobs:
144144
location: ${{ runner.temp }}
145145

146146
- name: Download diff
147-
uses: actions/download-artifact@v3
147+
uses: actions/download-artifact@v4
148148
with:
149149
path: ${{ needs.diff.outputs.path }}
150150
name: ${{ needs.diff.outputs.artifact }}
151151

152152
- name: Remove no longer needed artifact
153-
uses: geekyeggo/delete-artifact@v2
153+
uses: geekyeggo/delete-artifact@v5
154154
with:
155155
name: ${{ needs.diff.outputs.artifact }}
156156

@@ -376,16 +376,23 @@ jobs:
376376
if: env.PASS == 'false'
377377
run: touch ${{ env.FAIL_FLAG_PATH }} # Arbitrary file to provide content for the flag artifact
378378

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+
379386
# The value of a job matrix output is set by whichever job happened to run last, not of use for this application.
380387
# So it's necessary to use an alternative means of indicating that at least one submission failed the checks.
381388
- name: Upload failure flag artifact
382389
if: env.PASS == 'false'
383-
uses: actions/upload-artifact@v3
390+
uses: actions/upload-artifact@v4
384391
with:
385392
if-no-files-found: error
386393
include-hidden-files: true
387394
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 }}
389396

390397
check-submissions-result:
391398
needs: check-submissions
@@ -394,13 +401,22 @@ jobs:
394401
outputs:
395402
pass: ${{ steps.failure-flag-exists.outcome == 'failure' }}
396403

404+
env:
405+
CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH: ${{ github.workspace }}/artifacts
406+
397407
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+
398414
- name: Check for existence of submission check failure flag artifact
399415
id: failure-flag-exists
400-
uses: actions/download-artifact@v3
401416
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 }}"
404420
405421
check-submissions-fail:
406422
needs:

.github/workflows/sync-labels.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919

2020
env:
2121
CONFIGURATIONS_FOLDER: .github/label-configuration-files
22-
CONFIGURATIONS_ARTIFACT: label-configuration-files
22+
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-
2323

2424
jobs:
2525
check:
@@ -70,13 +70,13 @@ jobs:
7070
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
7171

7272
- name: Pass configuration files to next job via workflow artifact
73-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
7474
with:
7575
path: |
7676
*.yaml
7777
*.yml
7878
if-no-files-found: error
79-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
79+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }}
8080

8181
sync:
8282
needs: download
@@ -107,16 +107,17 @@ jobs:
107107
- name: Checkout repository
108108
uses: actions/checkout@v4
109109

110-
- name: Download configuration files artifact
111-
uses: actions/download-artifact@v3
110+
- name: Download configuration file artifacts
111+
uses: actions/download-artifact@v4
112112
with:
113-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
113+
merge-multiple: true
114+
pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
114115
path: ${{ env.CONFIGURATIONS_FOLDER }}
115116

116-
- name: Remove unneeded artifact
117-
uses: geekyeggo/delete-artifact@v2
117+
- name: Remove unneeded artifacts
118+
uses: geekyeggo/delete-artifact@v5
118119
with:
119-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
120+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
120121

121122
- name: Merge label configuration files
122123
run: |

0 commit comments

Comments
 (0)