11# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
22name : Sync Labels
33
4- # See: https://docs.github.com/en/ actions/reference /events-that-trigger-workflows
4+ # See: https://docs.github.com/actions/using-workflows /events-that-trigger-workflows
55on :
66 push :
77 paths :
2424jobs :
2525 check :
2626 runs-on : ubuntu-latest
27+ permissions :
28+ contents : read
2729
2830 steps :
2931 - name : Checkout repository
5557 download :
5658 needs : check
5759 runs-on : ubuntu-latest
60+ permissions : {}
5861
5962 strategy :
6063 matrix :
@@ -71,22 +74,25 @@ jobs:
7174 file-url : https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
7275
7376 - name : Pass configuration files to next job via workflow artifact
74- uses : actions/upload-artifact@v3
77+ uses : actions/upload-artifact@v4
7578 with :
7679 path : |
7780 *.yaml
7881 *.yml
7982 if-no-files-found : error
80- name : ${{ env.CONFIGURATIONS_ARTIFACT }}
83+ name : ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }}
8184
8285 sync :
8386 needs : download
8487 runs-on : ubuntu-latest
88+ permissions :
89+ contents : read
90+ issues : write
8591
8692 steps :
8793 - name : Set environment variables
8894 run : |
89- # See: https://docs.github.com/en/ actions/reference /workflow-commands-for-github-actions#setting-an-environment-variable
95+ # See: https://docs.github.com/actions/using-workflows /workflow-commands-for-github-actions#setting-an-environment-variable
9096 echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
9197
9298 - name : Determine whether to dry run
@@ -103,21 +109,22 @@ jobs:
103109 run : |
104110 # Use of this flag in the github-label-sync command will cause it to only check the validity of the
105111 # configuration.
106- echo "::set-output name= flag:: --dry-run"
112+ echo "flag= --dry-run" >> $GITHUB_OUTPUT
107113
108114 - name : Checkout repository
109115 uses : actions/checkout@v4
110116
111117 - name : Download configuration files artifact
112- uses : actions/download-artifact@v3
118+ uses : actions/download-artifact@v4
113119 with :
114- name : ${{ env.CONFIGURATIONS_ARTIFACT }}
120+ pattern : ${{ env.CONFIGURATIONS_ARTIFACT }}-*
121+ merge-multiple : true
115122 path : ${{ env.CONFIGURATIONS_FOLDER }}
116123
117124 - name : Remove unneeded artifact
118- uses : geekyeggo/delete-artifact@v2
125+ uses : geekyeggo/delete-artifact@v5
119126 with :
120- name : ${{ env.CONFIGURATIONS_ARTIFACT }}
127+ name : ${{ env.CONFIGURATIONS_ARTIFACT }}-*
121128
122129 - name : Merge label configuration files
123130 run : |
0 commit comments