Skip to content

ci(fork): run macOS jobs on the owner's self-hosted Mac behind an approval gate - #7

Merged
HernandoR merged 4 commits into
feature/fork-cli-command-not3from
ci/macos-self-hosted-runner
Dec 3, 2026
Merged

HernandoR merged 4 commits into
feature/fork-cli-command-not3from
ci/macos-self-hosted-runner

Conversation

@HernandoR

Copy link
Copy Markdown
Owner

Problem

The fork's macOS jobs (the native mobile static analysis in CI and the macOS arm64 desktop build in the fork release workflow) ran on GitHub-hosted macos-26 runners. The owner wants these builds on their own self-hosted macOS 27 runner instead. Because the repository is public, a self-hosted runner must not run code from pull requests or runs the owner did not start.

Change

  • ci.yml: the "Mobile Native Static Analysis" job uses runs-on: self-hosted.
  • fork-release.yml: the macOS arm64 matrix entry uses runner: self-hosted. The workflow's first job (Preflight) carries the gate, because a reusable workflow call cannot take an environment.
  • Both gated jobs get environment: ${{ (github.actor == github.repository_owner && github.triggering_actor == github.repository_owner) && '' || 'macos-self-hosted' }}. When the owner both pushed and started the run, the job runs with no environment. Any other run waits for the owner's approval in the macos-self-hosted environment.
  • A release started by someone else waits at Preflight, so its Linux and Windows builds also wait for approval.
  • fork/check.ts fails if an upstream merge drops the gate line from either workflow.
  • fork/README.md describes the self-hosted macOS jobs and the approval gate.

The macos-self-hosted environment was created on the fork with the owner as the required reviewer. Without that reviewer rule, the gate does nothing.

Scope

This is a fork-only CI and release change requested directly by the repository owner, so there is no linked issue. It changes where macOS jobs run and who can start them. It adds no product features.

Verification

  • node fork/check.ts passes locally (fork/check: ok).
  • Both workflow files parse as YAML (checked with Python's yaml.safe_load).
  • Not checked: actionlint is not installed here, so the workflow syntax is unverified beyond YAML parsing. The '' environment expression for owner-started runs is unverified; the first CI run will show whether owner runs skip the environment and whether other runs wait for approval.
  • Not checked: the self-hosted runner itself. Its label is self-hosted, and the CI job runs brew bundle install --file apps/mobile/Brewfile on the Mac.

Change produced by: model claude-opus-5-5, harness Claude

- Move the native mobile lint and the macOS arm64 desktop build from GitHub-hosted macOS runners to the owner's self-hosted Mac.
- Gate runs the owner did not start (actor or triggering actor differs from the repo owner) behind the `macos-self-hosted` environment, so they wait for the owner's approval. The repo is public, so this keeps outside pull requests off the Mac.
- Add check.ts assertions for the environment gate in ci.yml and fork-release.yml.
- Update fork/README.md to describe the self-hosted macOS jobs and the required reviewer rule.
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 21.5 KiB — 24.4 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.9 KiB — 24.4 KiB ✅
Claude Live turn messages — 1 — 8 ✅

Other scenarios

No main baseline exists yet for these 64 scenario measurements.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded — 10.5 KiB — 12.7 KiB ✅
Codex short turn resume WebSocket messages — 2 — 2 ✅
Codex long turn running, cold open HTTP decoded — 281.7 KiB — 302.7 KiB ✅
Codex long turn running, cold open rows — 75 — 75 ✅
Codex long turn running, history page HTTP decoded — 92.4 KiB — 107.4 KiB ✅
Codex long turn running, history page rows — 75 — 75 ✅
Codex long turn finished, cold open HTTP decoded — 381.5 KiB — 410.2 KiB ✅
Codex long turn finished, cold open rows — 151 — 151 ✅
Codex long turn finished, socket cold open WebSocket decoded — 381.6 KiB — 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages — 2 — 2 ✅
Codex long turn finished, socket cold open rows — 151 — 151 ✅
Codex long turn finished, work page HTTP decoded — 186.2 KiB — 200.2 KiB ✅
Codex long turn finished, work page rows — 150 — 150 ✅
Codex idle thread resume WebSocket decoded — 65 B — 200 B ✅
Codex idle thread resume WebSocket messages — 1 — 1 ✅
Codex fleet shell snapshot HTTP decoded — 42.4 KiB — 53.7 KiB ✅
Codex fleet shell snapshot rows — 27 — 27 ✅
Codex fleet shell subscribe WebSocket decoded — 65 B — 200 B ✅
Codex fleet shell subscribe WebSocket messages — 1 — 1 ✅
Codex fleet shell resume check HTTP decoded — 18 B — 100 B ✅
Codex fleet shell resume check rows — 0 — 0 ✅
Codex stale shell reload HTTP decoded — 42.4 KiB — 53.7 KiB ✅
Codex stale shell reload rows — 27 — 27 ✅
Codex stale shell resume WebSocket decoded — 140 B — 400 B ✅
Codex stale shell resume WebSocket messages — 2 — 2 ✅
Codex stale todo list cold open HTTP decoded — 72.4 KiB — 83.0 KiB ✅
Codex stale todo list cold open rows — 75 — 75 ✅
Codex stale todo list cold open nodes — 2 — 4 ✅
Codex stale todo list cold open subagents — 2 — 4 ✅
Codex stale todo list cold open plans — 1 — 2 ✅
Codex stale todo list cold open providerTurns — 1 — 2 ✅
Codex stale todo list cold open checkpoints — 1 — 2 ✅
Claude short turn resume WebSocket decoded — 10.6 KiB — 12.7 KiB ✅
Claude short turn resume WebSocket messages — 2 — 2 ✅
Claude long turn running, cold open HTTP decoded — 283.3 KiB — 302.7 KiB ✅
Claude long turn running, cold open rows — 75 — 75 ✅
Claude long turn running, history page HTTP decoded — 93.4 KiB — 107.4 KiB ✅
Claude long turn running, history page rows — 75 — 75 ✅
Claude long turn finished, cold open HTTP decoded — 384.2 KiB — 410.2 KiB ✅
Claude long turn finished, cold open rows — 151 — 151 ✅
Claude long turn finished, socket cold open WebSocket decoded — 384.3 KiB — 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages — 2 — 2 ✅
Claude long turn finished, socket cold open rows — 151 — 151 ✅
Claude long turn finished, work page HTTP decoded — 188.1 KiB — 200.2 KiB ✅
Claude long turn finished, work page rows — 150 — 150 ✅
Claude idle thread resume WebSocket decoded — 66 B — 200 B ✅
Claude idle thread resume WebSocket messages — 1 — 1 ✅
Claude fleet shell snapshot HTTP decoded — 43.0 KiB — 53.7 KiB ✅
Claude fleet shell snapshot rows — 27 — 27 ✅
Claude fleet shell subscribe WebSocket decoded — 66 B — 200 B ✅
Claude fleet shell subscribe WebSocket messages — 1 — 1 ✅
Claude fleet shell resume check HTTP decoded — 18 B — 100 B ✅
Claude fleet shell resume check rows — 0 — 0 ✅
Claude stale shell reload HTTP decoded — 43.0 KiB — 53.7 KiB ✅
Claude stale shell reload rows — 27 — 27 ✅
Claude stale shell resume WebSocket decoded — 140 B — 400 B ✅
Claude stale shell resume WebSocket messages — 2 — 2 ✅
Claude stale todo list cold open HTTP decoded — 73.4 KiB — 83.0 KiB ✅
Claude stale todo list cold open rows — 75 — 75 ✅
Claude stale todo list cold open nodes — 2 — 4 ✅
Claude stale todo list cold open subagents — 2 — 4 ✅
Claude stale todo list cold open plans — 1 — 2 ✅
Claude stale todo list cold open providerTurns — 1 — 2 ✅
Claude stale todo list cold open checkpoints — 1 — 2 ✅

Baseline: unavailable · PR result: 9de188c · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

HernandoR and others added 3 commits December 3, 2026 00:35
…unner's PATH

The gate was written as `owner && '' || 'macos-self-hosted'`. '' is falsy in
GitHub expressions, so every run, the owner's included, waited for approval.
The condition is now inverted, and the owner's own pull requests from this
repository skip approval too.

The self-hosted runner's service PATH has no Homebrew, so `brew bundle` failed
with exit 127. A step now adds /opt/homebrew/bin (or /usr/local/bin) to PATH.

Both macOS jobs target [self-hosted, macOS, ARM64, tart]; release-desktop.yml
parses a JSON label list passed as its runner input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The self-hosted Tart VM has only the Command Line Tools, and Homebrew
builds swiftlint from source there, which needs a full Xcode. CI's macOS
job returns to macos-26, where it passed. The approval gate and the
Homebrew PATH step only served the self-hosted runner, so they go too.
The macOS release build stays on the self-hosted Mac behind the gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o runner

The v0.1.0 release's macOS build was cancelled after GitHub could not get a
macos-26 runner ("not acquired by Runner of type hosted"), not because the
build failed; earlier builds passed there. The release goes back to
macos-26, and release-desktop.yml loses its JSON runner hook.

GitHub has no setting for how long a job waits for a hosted runner, so
fork-release-retry.yml re-runs a Fork release's failed jobs, up to three
times, while a macOS job ended with that cancellation. Build failures and
manual cancels are left alone. The owner approval gate stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HernandoR
HernandoR merged commit 4754358 into feature/fork-cli-command-not3 Dec 3, 2026
26 of 27 checks passed
HernandoR added a commit that referenced this pull request Dec 3, 2026
…-main

ci(fork): bring PR #3 and PR #7 onto main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant