Skip to content

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Oct 16, 2025

Description

Adds explicit permissions: configuration to workflow files that don't already have permissions defined either at the workflow level or for all jobs.

  • If the workflow doesn't use secrets.GITHUB_TOKEN or github.token, sets permissions: {} to restrict all permissions.
  • If the workflow uses the GitHub token, adds permissions: with required permissions.

Motivation

Security best practice to explicitly declare GITHUB_TOKEN permissions instead of relying on default permissions, following the principle of least privilege by ensuring workflows only have the permissions they actually need.

Additional details

See: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token

Related issues and pull requests

Part of mdn/fred#924.

@caugner caugner requested review from a team and argl and removed request for a team October 16, 2025 15:48
@caugner caugner marked this pull request as ready for review October 16, 2025 16:19
@argl argl merged commit 4e2560b into main Oct 17, 2025
4 checks passed
@argl argl deleted the workflow-permissions branch October 17, 2025 13:08
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