Skip to content

Commit fed3364

Browse files
ci: add least-privilege permissions to GitHub Actions workflows
Add explicit workflow-level permissions for CI, lint, Reviewdog, and release automation. Allow Reviewdog to publish pull-request reviews. Limit every other workflow to the scopes it uses. Refs: APPSEC-164
1 parent e5e037e commit fed3364

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref }}
1010
cancel-in-progress: true
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
test-build:
1417
name: 👷 Test & Build

‎.github/workflows/initiate_release.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: "The new version number with 'v' prefix. Example: v1.40.1"
88
required: true
99

10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
1014
jobs:
1115
init_release:
1216
name: 🚀 Create release PR

‎.github/workflows/lint.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.head_ref }}
77
cancel-in-progress: true
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
lint:
1114
name: 👮 Lint

‎.github/workflows/reviewdog.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ concurrency:
66
group: ${{ github.workflow }}-${{ github.head_ref }}
77
cancel-in-progress: true
88

9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
913
jobs:
1014
reviewdog:
1115
name: 🐶 Reviewdog

0 commit comments

Comments
 (0)