Skip to content

ci: add permissions: contents: read to unit-tests#24

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

ci: add permissions: contents: read to unit-tests#24
arpitjain099 wants to merge 1 commit into
mlflow:masterfrom
arpitjain099:chore/declare-workflow-perms

Conversation

@arpitjain099
Copy link
Copy Markdown

Adds a workflow-level permissions: contents: read block to .github/workflows/unit-tests.yml.

The unit tests workflow only reads the repository contents; it does not push, comment, or release. Declaring the minimum scope means a compromised third-party action cannot abuse the run's token to escalate. This is the pattern GitHub recommends in their token hardening guide and is what OpenSSF Scorecard's Token-Permissions check looks for.

A recent reminder of why this matters: tj-actions/changed-files compromise in March 2025 (CVE-2025-30066).

Verified with python3 -c "import yaml; yaml.safe_load(open('.github/workflows/unit-tests.yml'))".

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