ci: make the reusable GPU eval refuse fork PRs itself - #339
Open
vivekkhandelwal1 wants to merge 1 commit into
Open
ci: make the reusable GPU eval refuse fork PRs itself#339vivekkhandelwal1 wants to merge 1 commit into
vivekkhandelwal1 wants to merge 1 commit into
Conversation
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.
Contributor
There was a problem hiding this comment.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eval-reusable.yml's job runs on the self-hosted MI350 and builds a container as root from the pull request's owndocker/**. If a fork PR ever reaches it, the cost is the host, not a red check.This closes no live hole. The only
pull_requestcaller,bump-validate.yml, already gates onhead.repo.full_name, and the org's fork-PR policy is set toall_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.ymlalready 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 aredocker/**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
gpu-tests.ymlusesworkflow_run/workflow_dispatchfornightly-eval.yml, sogithub.event_name != 'pull_request'short-circuits truebump-validate.ymlhas a single job with no dependents, so a skip on fork PRs cannot strand downstream work