fix: tighten workflow permissions and fix uv tool invocations#459
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves repository security and CI reliability by scoping GitHub Actions token permissions to the minimum required per job, and by making uv run tool invocations more robust under uv-managed environments.
Changes:
- Move elevated GitHub Actions permissions from workflow scope to the specific jobs that require them; set workflow-level permissions to
contents: read. - Update
Makefileto run pytest/flake8/mypy viapython -m ...underuv runto avoid missing console-script entry points. - Upgrade the transitive dependency PyJWT from
2.11.0to2.12.1inuv.lock.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Updates locked PyJWT version to include the security fix. |
Makefile |
Switches lint/test tool invocations to python -m ... for uv compatibility. |
.github/workflows/stale.yaml |
Sets workflow permissions to contents: read and scopes issue/PR permissions to the job. |
.github/workflows/scorecard.yml |
Replaces read-all with explicit minimal workflow/job permissions. |
.github/workflows/mark-ready-when-ready.yml |
Moves write permissions to the mark-ready job; keeps workflow at contents: read. |
.github/workflows/major-version-updater.yml |
Moves contents: write to the tag-update job; keeps workflow at contents: read. |
## What Move elevated permissions from workflow level to job level across four GitHub Actions workflows (major-version-updater, mark-ready-when-ready, scorecard, stale). Set all workflow-level permissions to contents: read. Fix Makefile to use `python -m` for flake8, mypy, and pytest since they lack console script entry points in the uv venv. Upgrade PyJWT from 2.11.0 to 2.12.1 to address CVE-2026-32597. ## Why Workflow-level permissions apply to all jobs, granting broader access than necessary. Moving write permissions to the specific jobs that need them follows the principle of least privilege. The Makefile commands failed because uv doesn't install console scripts for all packages; invoking via `python -m` ensures the tools are found. PyJWT <= 2.11.0 doesn't validate the RFC 7515 `crit` header parameter, rated HIGH (CVSS 7.5). ## Notes - The scorecard workflow previously used `permissions: read-all` which granted read access to all scopes; now explicitly scoped to only what's needed - The `uv run` to `uv run python -m` change also affects CI since the python-package workflow calls `make lint` and `make test` - PyJWT is a transitive dependency; verify downstream consumers aren't relying on the old crit-header-ignored behavior Signed-off-by: jmeridth <jmeridth@gmail.com>
8578602 to
5e0401a
Compare
Signed-off-by: jmeridth <jmeridth@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Proposed Changes
What
Move elevated permissions from workflow level to job level across four GitHub Actions workflows (major-version-updater, mark-ready-when-ready, scorecard, stale). Set all workflow-level permissions to contents: read. Fix Makefile to use
python -mfor flake8, mypy, and pytest since they lack console script entry points in the uv venv. Upgrade PyJWT from 2.11.0 to 2.12.1 to address CVE-2026-32597. This was achieved withuv lock --upgrade-package pyjwtWhy
Workflow-level permissions apply to all jobs, granting broader access than necessary. Moving write permissions to the specific jobs that need them follows the principle of least privilege. The Makefile commands failed because uv doesn't install console scripts for all packages; invoking via
python -mensures the tools are found. PyJWT <= 2.11.0 doesn't validate the RFC 7515critheader parameter, rated HIGH (CVSS 7.5).Notes
permissions: read-allwhich granted read access to all scopes; now explicitly scoped to only what's neededuv runtouv run python -mchange also affects CI since the python-package workflow callsmake lintandmake testReadiness Checklist
Author/Contributor
make lintand fix any issues that you have introducedmake testand ensure you have test coverage for the lines you are introducing