Skip to content

ci: add permissions block to restrict GITHUB_TOKEN scope - #1090

Open
Alb3e3 wants to merge 1 commit into
leethomason:masterfrom
Alb3e3:ci-permissions
Open

ci: add permissions block to restrict GITHUB_TOKEN scope#1090
Alb3e3 wants to merge 1 commit into
leethomason:masterfrom
Alb3e3:ci-permissions

Conversation

@Alb3e3

@Alb3e3 Alb3e3 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Add permissions: contents: read at the workflow level.

Why

Without an explicit permissions block, GitHub Actions workflows run with the default token permissions, which include write access to repository contents, packages, and other resources.

Adding contents: read restricts the token to read-only access, following the principle of least privilege. This reduces the potential impact if a dependency or action is compromised.

Files (1)

  • .github/workflows/test.yml

Validation

  • git diff --check passes
  • YAML syntax verified

Add `permissions: contents: read` at the workflow level to follow the
least-privilege principle. Without an explicit permissions block, workflows
run with the default token permissions which include write access to
repository contents and other resources.
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.

1 participant