Skip to content

Commit ceef76a

Browse files
starbopsclaude
andcommitted
fix(ci): add explicit permissions to GitHub Actions workflows
- Add workflow-level permissions with contents: read as default - Add security-events: write permission to security job for SARIF uploads - Add pages: write and id-token: write permissions to docs job for GitHub Pages - Add actions: write and pull-requests: write permissions to performance job for benchmarks - Follows principle of least privilege to address CodeQL security warnings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent bceeaee commit ceef76a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
env:
1010
GO_VERSION: '1.24.4'
1111

12+
# Security: Define minimal permissions at workflow level
13+
permissions:
14+
contents: read
15+
1216
# CI Strategy:
1317
# - Uses enhanced Makefile targets that adapt behavior based on CI environment
1418
# - Testing follows pyramid approach: many unit tests, some integration tests
@@ -74,6 +78,9 @@ jobs:
7478
security:
7579
name: Security Scan
7680
runs-on: ubuntu-latest
81+
permissions:
82+
contents: read
83+
security-events: write # Required for SARIF upload
7784

7885
steps:
7986
- name: Checkout code
@@ -175,6 +182,10 @@ jobs:
175182
name: Documentation
176183
runs-on: ubuntu-latest
177184
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
185+
permissions:
186+
contents: read
187+
pages: write # Required for GitHub Pages deployment
188+
id-token: write # Required for GitHub Pages deployment
178189

179190
steps:
180191
- name: Checkout code
@@ -218,6 +229,10 @@ jobs:
218229
name: Performance Tests
219230
runs-on: ubuntu-latest
220231
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
232+
permissions:
233+
contents: read
234+
actions: write # Required for benchmark action auto-push
235+
pull-requests: write # Required for benchmark action comments
221236

222237
steps:
223238
- name: Checkout code

0 commit comments

Comments
 (0)