Skip to content

Conversation

@mbroshi-stripe
Copy link
Contributor

Why?

Fix code scanning alerts about unlimited permissions in GitHub workflows. By default, workflows have read/write access to all scopes, which is a security concern. This change applies the principle of least privilege.

What?

  • Added permissions: {} at workflow level to restrict default permissions
  • Added contents: read permission to each job that needs repository access
  • The publish-docs job retains contents: write as it needs to push to gh-pages
  • The rules workflow gets empty permissions as it only runs shell scripts

See Also

Fix code scanning alert about unlimited permissions by applying the
principle of least privilege to all workflow jobs. Each job now has
only the permissions it actually needs:
- Build, test, publish, and compat jobs get contents: read
- publish-docs keeps contents: write (needs to push to gh-pages)
- rules workflow gets empty permissions (no repo access needed)

Committed-By-Agent: claude
@mbroshi-stripe mbroshi-stripe marked this pull request as ready for review January 12, 2026 20:20
@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner January 12, 2026 20:21
@mbroshi-stripe mbroshi-stripe requested review from prathmesh-stripe and removed request for a team January 12, 2026 20:21
@mbroshi-stripe mbroshi-stripe merged commit c5d0f0f into master Jan 12, 2026
14 checks passed
@mbroshi-stripe mbroshi-stripe deleted the mbroshi/add-permissions-to-workflows branch January 12, 2026 21:33
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.

3 participants