Skip to content

ci: fork-guard the changes jobs, which ran PR code on the self-hosted pool - #377

Open
avrabe wants to merge 2 commits into
mainfrom
ci/changes-job-fork-guard
Open

avrabe wants to merge 2 commits into
mainfrom
ci/changes-job-fork-guard

Conversation

@avrabe

@avrabe avrabe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The changes jobs in ci.yml (line 24) and systest.yml (line 45) run on a literal [self-hosted, linux, x64, light] list for every pull_request. They execute the PR checkout's own tools/ci/detect-changes.sh. A fork PR, including one from a deleted fork, therefore runs its own code on the self-hosted pool. #370 guarded every other job and missed these two. The v0.48.0 clean-room review found it.

Test first. no_pull_request_job_reaches_the_pool_without_the_fork_guard (runner_trust_boundary.rs) fails for any runs-on that names self-hosted in a pull_request-triggered workflow without the head.repo.full_name == github.repository guard. The first head (4819653e) carries only the test, and it must go red on these two lines. The fix commit follows.

Fix. Both jobs use the same fail-closed guard as the rest: the pool only when the event is not a pull_request or the head repository is this repository; otherwise ubuntu-24.04.

mutants.yml:156 also uses a literal list. It runs only on schedule and workflow_dispatch, so no fork reaches it, and the test skips it for that reason.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z

@avrabe

avrabe commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Negative control: test-only head 4819653 failed in run 44492243895 (macOS job), no_pull_request_job_reaches_the_pool_without_the_fork_guard naming exactly systest.yml:45 and ci.yml:24. Fix head: a9f9e49.

avrabe and others added 2 commits November 19, 2026 16:46
…rk guard

Fails on main as of c7ad6ea: the `changes` jobs in ci.yml and
systest.yml run on a literal [self-hosted, linux, x64, light] list and
execute the PR's own tools/ci/detect-changes.sh, so a fork PR runs its
code on the pool. Found by the v0.48.0 clean-room review. The fix
follows in the next commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z
Both ran on a literal [self-hosted, linux, x64, light] list for every
pull_request and executed the PR's own tools/ci/detect-changes.sh, so a
fork PR ran its code on the pool. They now use the same fail-closed
guard as every other job: the pool only for a non-PR event or a head
repository that is this repository, otherwise ubuntu-24.04.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KEjmjczUmt6Rdd9DRKe75Z
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.

1 participant