Skip to content

ci: make the reusable GPU eval refuse fork PRs itself - #339

Open
vivekkhandelwal1 wants to merge 1 commit into
mainfrom
ci/fork-guard-eval
Open

ci: make the reusable GPU eval refuse fork PRs itself#339
vivekkhandelwal1 wants to merge 1 commit into
mainfrom
ci/fork-guard-eval

Conversation

@vivekkhandelwal1

Copy link
Copy Markdown
Collaborator

Summary

eval-reusable.yml's job runs on the self-hosted MI350 and builds a container as root from the pull request's own docker/**. If a fork PR ever reaches it, the cost is the host, not a red check.

This closes no live hole. The only pull_request caller, bump-validate.yml, already gates on head.repo.full_name, and the org's fork-PR policy is set to all_external_contributors. The point is to make the callee safe by default instead of depending on every future caller to remember — an easy thing to miss when adding a PR trigger to a workflow that reads as nightly-only.

It's the same guard gpu-tests.yml already carries, so the pattern is consistent across everything that touches the self-hosted runner.

Why the callee and not just the callers

bump-validate.yml's trigger paths are docker/** and the requirements files — exactly the inputs that decide what gets built and executed as root in the container. That makes a forgotten guard on some future caller unusually expensive, and the callee is the one place that can't be forgotten.

Test plan

  • YAML parses; guard resolves to the same expression gpu-tests.yml uses
  • Nightly paths unaffected: in a called workflow these expressions see the caller's event, which is workflow_run / workflow_dispatch for nightly-eval.yml, so github.event_name != 'pull_request' short-circuits true
  • bump-validate.yml has a single job with no dependents, so a skip on fork PRs cannot strand downstream work
  • CI green

This job runs on the self-hosted MI350 and builds a container as root from
the pull request's own docker/**, so a fork PR reaching it costs the host,
not just a red check.

Nothing is exposed today: the only pull_request caller, bump-validate.yml,
already gates on head.repo.full_name, and the org requires approval for
external contributors. The guard is here so the callee is safe by default
rather than depending on every future caller to remember -- an easy thing
to miss when adding a PR trigger to a workflow that looks like it only
runs nightly.

In a called workflow these expressions see the caller's event, so the
nightly paths (workflow_run / workflow_dispatch) are unaffected.
Copilot AI balanced review requested due to automatic review settings August 7, 2026 07:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds defense-in-depth protection to prevent fork PRs from reaching the self-hosted GPU evaluation runner.

Changes:

  • Adds a job-level repository-origin guard.
  • Documents the security rationale and nightly behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +45 to +47
if: >-
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants