Skip to content

ci: declare per-job permissions on tests-schedule workflow#9492

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

ci: declare per-job permissions on tests-schedule workflow#9492
arpitjain099 wants to merge 1 commit into
pytorch:mainfrom
arpitjain099:chore/tests-schedule-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown

The tests-schedule workflow runs nightly against the dataset-download tests and, on schedule failure, uses JasonEtco/create-an-issue@v2.4.0 to open a tracking issue. Right now it doesn't declare a permissions: block.

The actual scope needed is small:

  • contents: read for actions/checkout
  • issues: write for JasonEtco/create-an-issue (POST /repos/{owner}/{repo}/issues)

This patch pins both at the job level, matching the per-job permission blocks already used by the reusable-test callers in this repo (build-cmake.yml, build-conda-linux.yml, build-conda-m1.yml, ...): typically id-token: write + contents: read for the OIDC + checkout pair.

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
  • a hypothetical compromise of JasonEtco/create-an-issue (cf. tj-actions/changed-files CVE-2025-30066) stays confined to "can open issues", not the broader default scope

update-viablestrict.yml is the other workflow in this repo that doesn't declare permissions, but it's deliberately small (one composite-action invocation, ~28 lines) and uses UPDATEBOT_TOKEN for any write path, so I left it out of this PR to keep the change focused.

No behavioural change.

The download job runs pytest against the dataset-download tests and,
on schedule failure, uses JasonEtco/create-an-issue to open a tracking
issue. That action's only API call is POST /repos/{owner}/{repo}/issues,
which needs issues:write. contents:read covers actions/checkout.

This matches the per-job permissions blocks already declared by the
reusable-test callers in this repo (id-token:write + contents:read on
build-cmake.yml, build-conda*.yml, etc).

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@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/vision/9492

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:

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