Skip to content

Commit b348867

Browse files
committed
Configure GITHUB_TOKEN permissions to support workflow use in private repositories
Read permissions are required in the "contents" scope in order to checkout private repositories. Even though those permissions are not required in this project where the workflow is installed in a public repository, this is a copy of a "template" that is intended to be applicable to any Arduino Tooling project. A small excess in permissions in the template was chosen instead of the alternative of having to maintain separate variants of each workflow for use in public or private repos.
1 parent 787ab78 commit b348867

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/check-npm-task.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ on:
2626
workflow_dispatch:
2727
repository_dispatch:
2828

29-
permissions:
30-
contents: read
31-
3229
jobs:
3330
run-determination:
3431
runs-on: ubuntu-latest
32+
permissions: {}
3533
outputs:
3634
result: ${{ steps.determination.outputs.result }}
3735
steps:
@@ -57,6 +55,8 @@ jobs:
5755
needs: run-determination
5856
if: needs.run-determination.outputs.result == 'true'
5957
runs-on: ubuntu-latest
58+
permissions:
59+
contents: read
6060

6161
steps:
6262
- name: Checkout repository
@@ -80,6 +80,8 @@ jobs:
8080
needs: run-determination
8181
if: needs.run-determination.outputs.result == 'true'
8282
runs-on: ubuntu-latest
83+
permissions:
84+
contents: read
8385

8486
steps:
8587
- name: Checkout repository

0 commit comments

Comments
 (0)