1
1
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
2
2
name : Sync Labels
3
3
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
5
5
on :
6
6
push :
7
7
paths :
24
24
jobs :
25
25
check :
26
26
runs-on : ubuntu-latest
27
+ permissions :
28
+ contents : read
27
29
28
30
steps :
29
31
- name : Checkout repository
55
57
download :
56
58
needs : check
57
59
runs-on : ubuntu-latest
60
+ permissions : {}
58
61
59
62
strategy :
60
63
matrix :
@@ -71,22 +74,25 @@ jobs:
71
74
file-url : https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
72
75
73
76
- name : Pass configuration files to next job via workflow artifact
74
- uses : actions/upload-artifact@v3
77
+ uses : actions/upload-artifact@v4
75
78
with :
76
79
path : |
77
80
*.yaml
78
81
*.yml
79
82
if-no-files-found : error
80
- name : ${{ env.CONFIGURATIONS_ARTIFACT }}
83
+ name : ${{ env.CONFIGURATIONS_ARTIFACT }}-${{ matrix.filename }}
81
84
82
85
sync :
83
86
needs : download
84
87
runs-on : ubuntu-latest
88
+ permissions :
89
+ contents : read
90
+ issues : write
85
91
86
92
steps :
87
93
- name : Set environment variables
88
94
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
90
96
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
91
97
92
98
- name : Determine whether to dry run
@@ -103,21 +109,22 @@ jobs:
103
109
run : |
104
110
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
105
111
# configuration.
106
- echo "::set-output name= flag:: --dry-run"
112
+ echo "flag= --dry-run" >> $GITHUB_OUTPUT
107
113
108
114
- name : Checkout repository
109
115
uses : actions/checkout@v4
110
116
111
117
- name : Download configuration files artifact
112
- uses : actions/download-artifact@v3
118
+ uses : actions/download-artifact@v4
113
119
with :
114
- name : ${{ env.CONFIGURATIONS_ARTIFACT }}
120
+ pattern : ${{ env.CONFIGURATIONS_ARTIFACT }}-*
121
+ merge-multiple : true
115
122
path : ${{ env.CONFIGURATIONS_FOLDER }}
116
123
117
124
- name : Remove unneeded artifact
118
- uses : geekyeggo/delete-artifact@v2
125
+ uses : geekyeggo/delete-artifact@v5
119
126
with :
120
- name : ${{ env.CONFIGURATIONS_ARTIFACT }}
127
+ name : ${{ env.CONFIGURATIONS_ARTIFACT }}-*
121
128
122
129
- name : Merge label configuration files
123
130
run : |
0 commit comments