Skip to content

ci: declare minimum GITHUB_TOKEN permissions on unit-tests#60

Open
arpitjain099 wants to merge 1 commit into
mlflow:mainfrom
arpitjain099:chore/declare-workflow-perms
Open

ci: declare minimum GITHUB_TOKEN permissions on unit-tests#60
arpitjain099 wants to merge 1 commit into
mlflow:mainfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

Hardens unit-tests.yml by declaring the minimum GITHUB_TOKEN scope it needs.

The workflow already runs read-only (checkout + unit tests). Without an explicit permissions: block, the run inherits the repo's default token permission. On older repositories that default is permissive read-write, which means any action invoked inside the job could in principle use the token to commit back to the branch, open issues, or modify releases. Whether that ever happens in practice depends on the supply chain of every action used in the workflow.

The fix: add permissions: contents: read at the top level. That tightens the scope to exactly what the workflow consumes. If a future step adds a genuinely write-scoped operation, the override can be added at the job level with explicit justification.

References:

YAML validated with yaml.safe_load. No other edits in the PR.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
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