Skip to content

Commit 92477b4

Browse files
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: naveensrinivasan <[email protected]>
1 parent 7251837 commit 92477b4

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

.github/workflows/doctoc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- "README.md"
77
- "docs/BestPractices.md"
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
doctoc:
1114
name: Doc TOC Check

.github/workflows/eclint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Test Whitespace and line endings
22

33
on: [pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
eclint:
710
runs-on: ubuntu-latest

.github/workflows/markdown-link-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
paths:
66
- "**/*.md"
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
markdown-link-check:
1013
runs-on: ubuntu-latest

.github/workflows/missing-checksum.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- ".github/workflows/missing-checksum.yml"
77
- "**/alpine*/Dockerfile"
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test:
1114
runs-on: ubuntu-latest

.github/workflows/shfmt.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
paths:
66
- "**/*.sh"
77

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

0 commit comments

Comments
 (0)