Skip to content

Commit cc5b1a6

Browse files
authored
github: Specify permissions on the job level, not the workflow level (#30)
1 parent a87939a commit cc5b1a6

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
workflow_call:
99
workflow_dispatch:
1010

11-
permissions:
12-
contents: read
13-
checks: write
14-
pull-requests: write
15-
1611
jobs:
1712
check_nipanel:
1813
name: Check nipanel
@@ -28,4 +23,8 @@ jobs:
2823
name: Report test results
2924
uses: ./.github/workflows/report_test_results.yml
3025
needs: [run_unit_tests]
31-
if: always()
26+
if: always()
27+
permissions:
28+
contents: read
29+
checks: write
30+
pull-requests: write

.github/workflows/PR.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
workflow_call:
99
workflow_dispatch:
1010

11-
permissions:
12-
contents: read
13-
checks: write
14-
pull-requests: write
15-
1611
concurrency:
1712
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1813
cancel-in-progress: true
@@ -21,3 +16,7 @@ jobs:
2116
run_ci:
2217
name: Run CI
2318
uses: ./.github/workflows/CI.yml
19+
permissions:
20+
contents: read
21+
checks: write
22+
pull-requests: write

.github/workflows/report_test_results.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ on:
44
workflow_call:
55
workflow_dispatch:
66

7-
permissions:
8-
contents: read
9-
checks: write
10-
pull-requests: write
11-
127
jobs:
138
report_test_results:
149
name: Report test results
1510
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
checks: write
14+
pull-requests: write
1615
steps:
1716
- name: Check out repo
1817
uses: actions/checkout@v4

0 commit comments

Comments
 (0)