Skip to content

CI: skip self-hosted jobs on fork PRs (#881) - #988

Merged
mkreyman merged 4 commits into
masterfrom
ci/fork-pr-guard
Oct 17, 2026
Merged

mkreyman merged 4 commits into
masterfrom
ci/fork-pr-guard

Conversation

@mkreyman

Copy link
Copy Markdown
Owner

Closes #881.

Problem

Fork PRs on this public repo run CI on [self-hosted, beelink]. Every job on that pool executes as the shared github-runner uid, which can read other pool slots' live JIT runner config and the secrets it carries. The approval policy (all_external_contributors, applied to the repo alongside this change) is a human backstop, not a structural one — a workflow run approved in error, or a pull_request race, still executes fork code on the pool.

Fix

Every self-hosted job in ci.yml (lint, test, retrieval-eval, security, dialyzer, scale-test) now carries:

if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository

On a fork PR each such job is skipped, and a skipped job reports success, so branch protection's required checks still pass. Same-repo PRs, pushes, and the schedule are untouched. mcp-server-ci.yml runs only on ubuntu-latest and needs no guard; there are no pull_request_target/workflow_run triggers anywhere.

Also in this branch

Deps: bandit 1.12.5 -> 1.13.1 (cherry-picked) — a new bandit advisory (CVE-2026-105660) published since #981 fails mix hex.audit in the commit hook fleet-wide; 1.13.1 is OSV-clean and the #981 ignore for CVE-2026-105659 is dropped (patched in 1.13.0). The endpoint still serves no HTTP/2.

Verification

  • YAML parses; guard expression evaluated against same-repo and fork pull_request events, push, and schedule.
  • The repo's fork-PR approval policy is all_external_contributors (verified via gh api).

A new advisory published since #981 — CVE-2026-105660 (MEDIUM, HTTP/1
request-target authority, GHSA-v53v-9hvg-37jf) — failed `mix hex.audit` in the
commit hook for every branch. Bandit 1.13.0 fixed it, and OSV reports 1.13.1
clean of every advisory 1.12.5 carried, including CVE-2026-105659 (HTTP/2),
so the #981 ignore entry comes out too. The endpoint still serves no HTTP/2
(`http_2_options: [enabled: false]`; Fly's proxy speaks HTTP/1.1 anyway) and
endpoint_http2_test.exs keeps that under test, with @acknowledged_bandit moved
to 1.13.1. thousand_island 1.5.0 -> 1.6.0 and hpax 1.0.4 -> 1.1.0 ride along
as bandit's raised requirements.
Fork-PR code on the shared self-hosted pool runs as the github-runner uid
every pool slot shares, with read access to other slots' live JIT config and
secrets. The five always-on self-hosted jobs (lint, test, retrieval-eval,
security, dialyzer) and scale-test now skip when the PR head repo is a fork;
a skipped job reports success, so required checks still pass. The human
backstop is the fork-PR approval policy (all_external_contributors), set on
the repo with this change.

Closes #881
@mkreyman

Copy link
Copy Markdown
Owner Author

Review round 1 (code) counted at e3f61173b56d via Skill lean-review. The review-round counter's merge gate reads this marker on any machine.

Four confirmed findings from the lean-review round on PR #988:

1. scale-nightly now carries the fork-PR guard too, keeping the Lint
   comment's "every self-hosted job" true and closing the hole a future
   trigger widening (pull_request as a pre-merge gate) would open.
2. scale-test's header comment now says it also runs on same-repo PRs,
   matching the `if:` below it.
3. config/runtime.exs's http_2 comment stops claiming a fix version for
   CVE-2026-105659 that was never verified; it records what is known
   (bandit 1.13.1 is OSV-clean) and why the option stays.
4. endpoint_http2_test.exs's @acknowledged_bandit comment is reworded to
   the same standard: 1.13.0 fixed CVE-2026-105660, OSV reports 1.13.1
   clean of every advisory 1.12.5 carried.
@mkreyman
mkreyman enabled auto-merge (squash) October 17, 2026 19:13
# Conflicts:
#	test/loopctl_web/endpoint_http2_test.exs
@mkreyman
mkreyman merged commit 66ec7d9 into master Oct 17, 2026
17 checks passed
@mkreyman
mkreyman deleted the ci/fork-pr-guard branch October 17, 2026 19:57
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.

Fork PRs on a public repo run on the shared self-hosted pool

1 participant