Skip to content

Split-trust runner model: self-hosted for trusted triggers, GitHub-hosted for PRs - #1541

Merged
JayVDZ merged 10 commits into
mainfrom
JayVDZ-patch-1
Aug 26, 2026
Merged

JayVDZ merged 10 commits into
mainfrom
JayVDZ-patch-1

Conversation

@JayVDZ

@JayVDZ JayVDZ commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Moves trusted-trigger workflows to the self-hosted runner while keeping every workflow an outsider can trigger on GitHub-hosted VMs. Reworked from the original all-workflows switch: on a public repository, pull_request jobs execute code from anyone's fork, so they must never reach our infrastructure.

Runner assignment

Workflow Trigger Runner
bench-sync push to main self-hosted
release tag push self-hosted (all jobs)
CI push main + PR conditional: push → self-hosted, PR → ubuntu-latest
CodeQL push + PR + schedule conditional: PR → ubuntu-latest, otherwise self-hosted
changelog-lint, regenerate-nuget-lock-files, docs, publish-api-reference PR / pull_request_target / light push jobs ubuntu-latest (reverted, no diff vs main)
claude issue/PR comments ubuntu-latest (comment-triggered = untrusted), plus a new author_association gate so only owners/members/collaborators can trigger it

Required org configuration (before merge is useful)

The runner group must:

  1. Enable Allow public repositories (JIM is public; without this every self-hosted job queues forever, which is what stalled this PR originally).
  2. Restrict the group to an allowed workflows list pinned to trusted refs, e.g. TetronIO/JIM/.github/workflows/ci.yml@refs/heads/main, .../release.yml@refs/tags/*. This is the enforcement layer: a fork PR that rewrites runs-on still cannot be assigned the runner, because its workflow runs from the PR merge ref, not main.

Also recommended: Settings → Actions → require approval for workflow runs from all outside collaborators.

Runner prerequisites

Docker engine and generous disk (release image builds; CI services: containers on push events).

Docs: n/a - CI/CD infrastructure change, no user-facing behaviour.

🤖 Generated with Claude Code

@JayVDZ
JayVDZ marked this pull request as ready for review August 26, 2026 13:25
@JayVDZ
JayVDZ enabled auto-merge (squash) August 26, 2026 13:25
Rework of the all-workflows self-hosted switch. pull_request-triggered jobs
(CI, CodeQL, changelog-lint) return to GitHub-hosted runners because fork PRs
execute untrusted code; push/tag/schedule-triggered jobs (main builds, CodeQL
scheduled scans, bench-sync, release) use the self-hosted runner. CI and CodeQL
select the runner per-event with a runs-on expression. claude.yml returns to
GitHub-hosted and gains an author_association gate so only owners, members and
collaborators can trigger it. docs, publish-api-reference and
regenerate-nuget-lock-files revert to GitHub-hosted unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@JayVDZ JayVDZ changed the title Change runner to self-hosted for bench-sync workflow Split-trust runner model: self-hosted for trusted triggers, GitHub-hosted for PRs Aug 26, 2026
@JayVDZ
JayVDZ merged commit dc83c3c into main Aug 26, 2026
20 checks passed
@JayVDZ
JayVDZ deleted the JayVDZ-patch-1 branch August 26, 2026 14:22
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