Skip to content

Commit 07f59d8

Browse files
authored
chore: use minimal permissions for workflows (coder#422)
* Restrict GITHUB_TOKEN for Quality workflow to metadata (read) and file contents (read) * Restrict GITHUB_TOKEN for Preview workflow to metadata (read), file contents (read), and pull request (read/write)
1 parent cb16e08 commit 07f59d8

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ on:
1111

1212
workflow_dispatch:
1313

14+
permissions:
15+
actions: none
16+
checks: none
17+
contents: read
18+
deployments: none
19+
issues: none
20+
packages: none
21+
pull-requests: none
22+
repository-projects: none
23+
security-events: none
24+
statuses: none
25+
1426
jobs:
1527
lint:
1628
name: Lint

.github/workflows/preview.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
actions: none
10+
checks: none
11+
contents: read
12+
deployments: none
13+
issues: none
14+
packages: none
15+
pull-requests: write
16+
repository-projects: none
17+
security-events: none
18+
statuses: none
19+
820
jobs:
921
preview:
1022
name: Preview

0 commit comments

Comments
 (0)