ci: declare workflow-level contents: read on 6 workflows#2042
ci: declare workflow-level contents: read on 6 workflows#2042arpitjain099 wants to merge 2 commits into
contents: read on 6 workflows#2042Conversation
Pins the default GITHUB_TOKEN to contents: read on the workflows in .github/workflows/ that don't call a GitHub API beyond the initial checkout. The other workflows in this directory are left implicit because they need write scopes that a maintainer is better placed to declare. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection if the default ever widens, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Greptile SummaryThis PR pins the
|
| Filename | Overview |
|---|---|
| .github/workflows/ci-main.yml | Adds workflow-level permissions: contents: read; the two reusable workflows it calls (pre-commit and docker-build-and-test) require no additional GITHUB_TOKEN scopes. |
| .github/workflows/ci-pull-request.yml | Adds workflow-level permissions: contents: read; all jobs only need repo checkout access from GITHUB_TOKEN. |
| .github/workflows/docker-build-arm.yml | Adds workflow-level permissions: contents: read; Docker build is local-only (--load, no push). |
| .github/workflows/integration-test-library-mode.yml | Adds workflow-level permissions: contents: read; workflow only checks out code and runs integration tests using injected NVIDIA API key secrets, not GITHUB_TOKEN. |
| .github/workflows/retriever-unit-tests.yml | Adds workflow-level permissions: contents: read; workflow only checks out code and runs unit tests — no GITHUB_TOKEN write operations at all. |
| .github/workflows/scheduled-nightly.yml | Adds workflow-level permissions: contents: read; Docker pushes use DOCKER_PASSWORD secret and PyPI publishes use Artifactory credentials — neither relies on GITHUB_TOKEN. |
Reviews (2): Last reviewed commit: "Merge branch 'main' into chore/declare-w..." | Re-trigger Greptile
Pins the default
GITHUB_TOKENtocontents: readon 6 workflows in.github/workflows/that don't call a GitHub API beyond the initial checkout.Why
CVE-2025-30066 (March 2025
tj-actions/changed-filessupply-chain compromise) exfiltratedGITHUB_TOKENfrom workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF ScorecardToken-Permissionscheck.YAML validated locally with
yaml.safe_loadon each touched file.