Skip to content

Commit 90d3d77

Browse files
committed
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.
1 parent 0aec778 commit 90d3d77

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Diff for: .github/workflows/sync-labels.yml

+7-6
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:
@@ -77,7 +77,7 @@ jobs:
7777
*.yaml
7878
*.yml
7979
if-no-files-found: error
80-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
80+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }}
8181

8282
sync:
8383
needs: download
@@ -108,16 +108,17 @@ jobs:
108108
- name: Checkout repository
109109
uses: actions/checkout@v4
110110

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

117-
- name: Remove unneeded artifact
118+
- name: Remove unneeded artifacts
118119
uses: geekyeggo/delete-artifact@v5
119120
with:
120-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
121+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
121122

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

0 commit comments

Comments
 (0)