Skip to content

Commit ae2af8a

Browse files
committed
Improve workflow permissions
Since our project has been created before February 2023, we have the more permissive permission `write-all` set for the `GITHUB_TOKEN` used by the workflow. Therefore, to apply the principle of least privilege, we now explicitly specify the permisisons needed for each workflow. In addition, I've applied the same styling format for all current workflows for consistency.
1 parent 3fba133 commit ae2af8a

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

.github/workflows/pr-check-signed-commits.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
name: Check signed commits in PR
2+
23
on: pull_request_target
34

5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
49
jobs:
510
build:
611
name: Check signed commits in PR
7-
permissions:
8-
contents: read
9-
pull-requests: write
1012
runs-on: ubuntu-latest
1113
steps:
1214
- name: Check signed commits in PR

.github/workflows/release-pr.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
name: Open Release PR for review
2+
13
on:
24
create:
35
branches:
46

5-
name: Open Release PR for review
7+
permissions:
8+
contents: read
9+
pull-requests: write
610

711
jobs:
812
# This job is necessary because GitHub does not (yet) support

.github/workflows/release.yml

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

8+
permissions:
9+
contents: write
10+
811
jobs:
912
release:
1013
runs-on: ubuntu-latest

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: Tests
2-
permissions:
3-
contents: read
2+
43
on:
54
push:
65
branches: main
76
pull_request:
87

8+
permissions:
9+
contents: read
10+
911
jobs:
1012
test:
1113
name: Test

0 commit comments

Comments
 (0)