From 67761062a34661af9c26250f76f8fbb6db2a22b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:37:41 +0000 Subject: [PATCH 1/5] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/manage-prs.yml | 4 ++-- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manage-prs.yml b/.github/workflows/manage-prs.yml index 06b4b5959..811e4686c 100644 --- a/.github/workflows/manage-prs.yml +++ b/.github/workflows/manage-prs.yml @@ -114,7 +114,7 @@ jobs: run: echo "::set-output name=head::$(jq -c .head.sha "${{ steps.configuration.outputs.path }}/${{ env.JSON_IDENTIFIER }}")" - name: Upload diff file to workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: ${{ steps.configuration.outputs.path }}/${{ steps.configuration.outputs.filename }} name: ${{ steps.configuration.outputs.artifact }} @@ -380,7 +380,7 @@ jobs: # So it's necessary to use an alternative means of indicating that at least one submission failed the checks. - name: Upload failure flag artifact if: env.PASS == 'false' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error include-hidden-files: true diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9cde1acc6..7680b3776 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -70,7 +70,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml From 1084031aba807374770846019eceaecef534ec15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 01:46:16 +0000 Subject: [PATCH 2/5] Bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/manage-prs.yml | 4 ++-- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manage-prs.yml b/.github/workflows/manage-prs.yml index 811e4686c..84375ed6e 100644 --- a/.github/workflows/manage-prs.yml +++ b/.github/workflows/manage-prs.yml @@ -144,7 +144,7 @@ jobs: location: ${{ runner.temp }} - name: Download diff - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: path: ${{ needs.diff.outputs.path }} name: ${{ needs.diff.outputs.artifact }} @@ -397,7 +397,7 @@ jobs: steps: - name: Check for existence of submission check failure flag artifact id: failure-flag-exists - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 continue-on-error: true with: name: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 7680b3776..2e1d6e05c 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -108,7 +108,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From dfb6a0cc83043641da333899b9eab080d4672fec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 01:02:30 +0000 Subject: [PATCH 3/5] Bump geekyeggo/delete-artifact from 2 to 5 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/manage-prs.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manage-prs.yml b/.github/workflows/manage-prs.yml index 84375ed6e..d765ec2d5 100644 --- a/.github/workflows/manage-prs.yml +++ b/.github/workflows/manage-prs.yml @@ -150,7 +150,7 @@ jobs: name: ${{ needs.diff.outputs.artifact }} - name: Remove no longer needed artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ needs.diff.outputs.artifact }} diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 2e1d6e05c..53a9f54f4 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 4a429929085a70b67859446f59a0e5f30eecc0c8 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 20 Oct 2024 08:17:40 -0700 Subject: [PATCH 4/5] Don't upload multiple times to same artifact in label sync workflow The "Sync Labels" GitHub Actions workflow is configured to allow the use of multiple shared label configuration files. This is done by using a job matrix in the GitHub Actions workflow to download each of the files from the source repository in a parallel GitHub Actions workflow job. A GitHub Actions workflow artifact was used to transfer the generated files between sequential jobs in the workflow. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for the transfer of all the shared label configuration files, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action. --- .github/workflows/sync-labels.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 53a9f54f4..514f29a7d 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -19,7 +19,7 @@ on: env: CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- jobs: check: @@ -76,7 +76,7 @@ jobs: *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} sync: needs: download @@ -107,16 +107,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download configuration files artifact + - name: Download configuration file artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* path: ${{ env.CONFIGURATIONS_FOLDER }} - - name: Remove unneeded artifact + - name: Remove unneeded artifacts uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* - name: Merge label configuration files run: | From 5d935c3b7c3c1106216bd62e1d9ea35d3adb885f Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 23 Oct 2024 21:32:49 -0700 Subject: [PATCH 5/5] Don't upload multiple times to same artifact in "Manage PRs" workflow The `check-submissions` job of the "Run integration tests" GitHub Actions workflow is configured to generate multiple parallel jobs, one for each of the submitted libraries. The subsequent jobs must be able to determine whether any of the libraries failed the checks. This is done by the matrix jobs in which checks failed uploading a flag file to a GitHub Actions workflow artifact, then the subsequent jobs checking for the presence of an artifact. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for all flag files, with each of the parallel jobs uploading its flag file to that single artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the parallel jobs. These artifacts can be downloaded in aggregate by using the artifact name globbing feature which was introduced in version 4.1.0 of the "actions/download-artifact" action. --- .github/workflows/manage-prs.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manage-prs.yml b/.github/workflows/manage-prs.yml index d765ec2d5..9282bb924 100644 --- a/.github/workflows/manage-prs.yml +++ b/.github/workflows/manage-prs.yml @@ -5,7 +5,7 @@ env: MAINTAINERS: | # GitHub user names to request reviews from in cases where PRs can't be managed automatically. - per1234 - CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT: check-submissions-failed + CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX: check-submissions-failed- ERROR_MESSAGE_PREFIX: ":x: **ERROR:** " on: @@ -376,6 +376,13 @@ jobs: if: env.PASS == 'false' run: touch ${{ env.FAIL_FLAG_PATH }} # Arbitrary file to provide content for the flag artifact + # Each workflow artifact must have a unique name. The job matrix doesn't provide a guaranteed unique string to use + # for a name so it is necessary to generate one. + - name: Generate unique artifact suffix + if: env.PASS == 'false' + run: | + echo "CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_SUFFIX=$(cat /proc/sys/kernel/random/uuid)" >> "$GITHUB_ENV" + # The value of a job matrix output is set by whichever job happened to run last, not of use for this application. # So it's necessary to use an alternative means of indicating that at least one submission failed the checks. - name: Upload failure flag artifact @@ -385,7 +392,7 @@ jobs: if-no-files-found: error include-hidden-files: true path: ${{ env.FAIL_FLAG_PATH }} - name: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT }} + name: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX }}${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_SUFFIX }} check-submissions-result: needs: check-submissions @@ -394,13 +401,22 @@ jobs: outputs: pass: ${{ steps.failure-flag-exists.outcome == 'failure' }} + env: + CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH: ${{ github.workspace }}/artifacts + steps: + - name: Download submission check failure flag artifacts + uses: actions/download-artifact@v4 + with: + path: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH }} + pattern: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PREFIX }}* + - name: Check for existence of submission check failure flag artifact id: failure-flag-exists - uses: actions/download-artifact@v4 continue-on-error: true - with: - name: ${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT }} + # actions/download-artifact does not create a folder per its `path` input if no artifacts match `pattern`. + run: | + test -d "${{ env.CHECK_SUBMISSIONS_FAIL_FLAG_ARTIFACT_PATH }}" check-submissions-fail: needs: