Skip to content

Commit f630528

Browse files
committed
workflow: set restricted permissions
If no explicit permissions are set for a GitHub Actions run, then the repository or organization permissions are used, which can be too broad. Let's specifically set the permissions to read-only for the contents of the repository, since we only need to clone and test our code. That way, we'll be taking advantage of the principle of least privilege.
1 parent 48b0862 commit f630528

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/go-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: go test
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: golangci-lint
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58

0 commit comments

Comments
 (0)