Skip to content

ci: declare least-privilege GITHUB_TOKEN permissions - #63

Merged
melonamin merged 1 commit into
melonamin:linux-portfrom
alexandru-savinov:upstream/ci-token-permissions
Nov 25, 2026
Merged

melonamin merged 1 commit into
melonamin:linux-portfrom
alexandru-savinov:upstream/ci-token-permissions

Conversation

@alexandru-savinov

Copy link
Copy Markdown

This gives ci.yml an explicit read-only GITHUB_TOKEN instead of relying on the repository's default workflow permissions. It's a small hardening change with no behaviour change.

  • Top-level permissions: contents: read covers every job.
  • The changes job also gets pull-requests: read, which dorny/paths-filter needs to list changed files on pull_request events.

GitHub's code scanning (CodeQL actions/missing-workflow-permissions) and OpenSSF Scorecard flag the current file; I noticed it because my fork keeps ci.yml byte-identical to linux-port.

Two related changes I can send separately if you want them (I haven't been able to run your release workflow, so I'm only offering them):

  1. In release-linux.yml, move contents, id-token and attestations: write from the workflow level down to the publish-linux job, so the build job runs with a read-only token.
  2. Pin the workflow actions to commit SHAs (with # vX.Y.Z comments), plus a github-actions entry in dependabot.yml so the pins stay current.

Checked with actionlint 1.7.12 (no findings).

Prepared with Claude Code; posted on my behalf.

🤖 Generated with Claude Code

Set a read-only default token for ci.yml, and give the paths-filter job
the pull-requests: read scope it needs to list changed files on PRs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NKoFjbfbJgKfy3aRr46bxn
@melonamin

Copy link
Copy Markdown
Owner

Thanks for tightening the CI token permissions and keeping the change focused. Reviewed the workflow permissions, confirmed actionlint passes, and checked all six CI jobs are green. Merging this now.

@melonamin
melonamin merged commit 57ad93f into melonamin:linux-port Nov 25, 2026
6 checks passed
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