Skip to content

Commit 8ed3773

Browse files
committed
chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: neilnaveen <[email protected]>
1 parent 4c8b4d1 commit 8ed3773

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [master]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
name: build

.github/workflows/golangci-lint.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ on:
99
- main
1010
pull_request:
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
golangci:
17+
permissions:
18+
contents: read # for actions/checkout to fetch code
19+
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
1420
name: lint
1521
runs-on: ubuntu-latest
1622
steps:

0 commit comments

Comments
 (0)