Skip to content

Commit b3da945

Browse files
authored
Merge pull request #2819 from boahc077/github_actions_token_permission
ci: add minimum GitHub token permissions for workflows
2 parents ca7ae52 + 67a1a9d commit b3da945

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/header_checks.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@ on:
1313
- 'README.md'
1414
- 'RELEASE-NOTES.txt'
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
windows:
21+
permissions:
22+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
23+
contents: read # for actions/checkout to fetch code
1824
name: Windows
1925
runs-on: windows-latest
2026

@@ -47,6 +53,9 @@ jobs:
4753
run: make -j2 test-headers
4854

4955
opencl:
56+
permissions:
57+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
58+
contents: read # for actions/checkout to fetch code
5059
name: OpenCL
5160
runs-on: ubuntu-latest
5261

@@ -64,6 +73,9 @@ jobs:
6473
echo "STAN_OPENCL=true" > make/local
6574
make -j2 test-headers
6675
no_range_checks:
76+
permissions:
77+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
78+
contents: read # for actions/checkout to fetch code
6779
name: NoRange
6880
runs-on: ubuntu-latest
6981

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ on:
1212
- 'LICENSE.md'
1313
- 'README.md'
1414
- 'RELEASE-NOTES.txt'
15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
prim-rev:
20+
permissions:
21+
actions: write # for n1hility/cancel-previous-runs to create & stop workflow runs
22+
contents: read # for actions/checkout to fetch code
1723
name: prim and rev tests
1824
runs-on: windows-latest
1925

0 commit comments

Comments
 (0)