Skip to content

ci: add permissions block and update actions/checkout to v4 - #1063

Open
Alb3e3 wants to merge 1 commit into
DaveGamble:masterfrom
Alb3e3:ci-hardening
Open

ci: add permissions block and update actions/checkout to v4#1063
Alb3e3 wants to merge 1 commit into
DaveGamble:masterfrom
Alb3e3:ci-hardening

Conversation

@Alb3e3

@Alb3e3 Alb3e3 commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • Add permissions: contents: read at the workflow level
  • Update actions/checkout from v2 to v4

Why

  1. Least-privilege GITHUB_TOKEN: Without an explicit permissions block, 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, reducing the blast radius if a dependency or action is compromised.

  2. Deprecated action version: actions/checkout@v2 is deprecated and no longer receives updates. v4 includes security fixes and performance improvements.

Files (1)

  • .github/workflows/CI.yml

Validation

  • git diff --check passes
  • YAML syntax verified

- Add `permissions: contents: read` at workflow level to follow least-privilege principle
- Update `actions/checkout` from v2 to v4 (v2 is deprecated)

This reduces the default GITHUB_TOKEN scope and uses the current checkout action version.
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