Skip to content

ci: declare contents:read on Lint workflow#4193

Open
arpitjain099 wants to merge 1 commit into
pytorch:mainfrom
arpitjain099:chore/lint-permissions
Open

ci: declare contents:read on Lint workflow#4193
arpitjain099 wants to merge 1 commit into
pytorch:mainfrom
arpitjain099:chore/lint-permissions

Conversation

@arpitjain099

Copy link
Copy Markdown

The Lint workflow runs pre-commit run --all-files inside a conda-incubator/setup-miniconda env, then git diff to surface any pre-commit-applied changes. No GitHub API write, no comment-on-PR step.

This patch pins the workflow to permissions: contents: read, matching the per-job permission blocks already declared by the build / unittest / docs workflows in this repo (typically id-token: write + contents: read for the reusable-test callers).

With explicit scope:

  • the workflow token can't be widened by a future change to the repo default
  • the SLSA / OpenSSF Scorecard Token-Permissions check passes for this file
  • any hypothetical compromise of conda-incubator/setup-miniconda or actions/checkout (cf. tj-actions/changed-files CVE-2025-30066) stays boxed in read-only

unittest-windows-cpu.yml and unittest-windows-gpu.yml are the other workflows without a permissions block, but they use actions/cache and a more involved windows test setup, so I've left them out of this PR to keep the change focused and avoid the cache-write permissions discussion.

No behavioural change.

@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 01:45
@pytorch-bot

pytorch-bot Bot commented May 14, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/audio/4193

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed label May 14, 2026
The pre-commit-checks job runs pre-commit hooks inside a miniconda
env and a final `git diff`. No GitHub API write beyond
actions/checkout. contents:read is the floor.

Style matches the per-job permissions blocks already declared by the
build-* / unittest-* / docs-* workflows in this repo (typically
id-token: write + contents: read at the job level).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@arpitjain099 arpitjain099 force-pushed the chore/lint-permissions branch from b6ca980 to b265e99 Compare June 10, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant