Skip to content

Commit 8cd1bf4

Browse files
committed
Updated sync-labels workflow
1 parent 1d4910b commit 8cd1bf4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
22
name: 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
55
on:
66
push:
77
paths:
@@ -24,6 +24,8 @@ env:
2424
jobs:
2525
check:
2626
runs-on: ubuntu-latest
27+
permissions:
28+
contents: read
2729

2830
steps:
2931
- name: Checkout repository
@@ -55,6 +57,7 @@ jobs:
5557
download:
5658
needs: check
5759
runs-on: ubuntu-latest
60+
permissions: {}
5861

5962
strategy:
6063
matrix:
@@ -81,11 +84,14 @@ jobs:
8184
sync:
8285
needs: download
8386
runs-on: ubuntu-latest
87+
permissions:
88+
contents: read
89+
issues: write
8490

8591
steps:
8692
- name: Set environment variables
8793
run: |
88-
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
94+
# See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
8995
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
9096
9197
- name: Determine whether to dry run
@@ -102,7 +108,7 @@ jobs:
102108
run: |
103109
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
104110
# configuration.
105-
echo "::set-output name=flag::--dry-run"
111+
echo "flag=--dry-run" >> $GITHUB_OUTPUT
106112
107113
- name: Checkout repository
108114
uses: actions/checkout@v3
@@ -135,4 +141,4 @@ jobs:
135141
github-label-sync \
136142
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
137143
${{ steps.dry-run.outputs.flag }} \
138-
${{ github.repository }}
144+
${{ github.repository }}

0 commit comments

Comments
 (0)