Skip to content

ci: add least-privilege permissions to GitHub workflows - #36

Merged
adityathebe merged 1 commit into
mainfrom
claude/pull-request-1748je
Jul 17, 2026
Merged

ci: add least-privilege permissions to GitHub workflows#36
adityathebe merged 1 commit into
mainfrom
claude/pull-request-1748je

Conversation

@adityathebe

Copy link
Copy Markdown
Member

Summary

Resolves the CodeQL "Workflow does not contain permissions" alerts (#1, #3, #8, #9, #11) on main. Both workflows previously relied on the repository's default GITHUB_TOKEN scope, which is broader than needed. This PR declares explicit, least-privilege permissions for every job.

Changes

.github/workflows/test.yaml

  • Add top-level permissions: contents: read (the test job only checks out code).

.github/workflows/release.yaml

  • Add top-level permissions: contents: read as the default; read-only jobs (docker-merge, helm) inherit it.
  • semantic-releasecontents: write (create releases/tags) plus issues: write / pull-requests: write (semantic-release comments on released issues/PRs).
  • binarycontents: write (uploads binaries to the release via upload-release-action).
  • docker already declared contents: read / packages: write — left unchanged.

The helm job pushes to the external charts repo using the FLANKBOT PAT rather than GITHUB_TOKEN, so contents: read is sufficient there.

Verification

Both files parse as valid YAML and every job now has an explicit permission set (either its own override or the inherited top-level default).

🤖 Generated with Claude Code

https://claude.ai/code/session_012piXvDqsCcLoVenm2oVCUy


Generated by Claude Code

Address CodeQL 'Workflow does not contain permissions' alerts by
declaring explicit GITHUB_TOKEN permissions.

- Add a top-level 'contents: read' default to both workflows so all
  jobs run read-only unless they opt into more.
- semantic-release: contents/issues/pull-requests write for release
  creation and PR/issue comments.
- binary: contents write to upload release assets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012piXvDqsCcLoVenm2oVCUy
@adityathebe
adityathebe enabled auto-merge (squash) July 17, 2026 06:15
@adityathebe
adityathebe merged commit 6c6847b into main Jul 17, 2026
5 checks passed
@adityathebe
adityathebe deleted the claude/pull-request-1748je branch July 17, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants