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.

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 requested a review from a team as a code owner May 14, 2026 01:45
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 14, 2026

🔗 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.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 2 Unrelated Failures

As of commit b6ca980 with merge base c0cbdb9 (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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
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