Skip to content

Commit 2fa0527

Browse files
committed
ci: Use least privilege principle for permissions
Declares only the required permissions per workflow.
1 parent 7654009 commit 2fa0527

File tree

5 files changed

+17
-0
lines changed

5 files changed

+17
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
push:
44
branches:
55
- main
6+
7+
permissions:
8+
contents: write
9+
610
jobs:
711
build-and-deploy:
812
name: Build and Deploy

.github/workflows/github-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- main
1010

11+
# No permissions are required for this workflow
12+
permissions: {}
13+
1114
jobs:
1215
test:
1316
name: General checks and tests

.github/workflows/issues.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
schedule:
44
- cron: '00 20 * * *'
55

6+
permissions:
7+
issues: write
8+
69
jobs:
710
stale:
811
name: Flag and close stale issues

.github/workflows/reuse-compliance.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
branches:
99
- main
1010

11+
# No permissions are required for this workflow
12+
permissions: {}
13+
1114
jobs:
1215
compliance-check:
1316
name: Compliance Check

.github/workflows/security-audit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
schedule:
55
- cron: "36 4 * * *" # Run once a day
66
workflow_dispatch:
7+
8+
# No permissions are required for this workflow
9+
permissions: {}
10+
711
jobs:
812
security-scan:
913
name: Security Audit

0 commit comments

Comments
 (0)