Skip to content

Run fork pull requests' CI on Diffinery's runners, not GitHub's - #22

Merged
altugank merged 3 commits into
codician-team:mainfrom
alankernel67:claude/skip-docker-e2e-on-forks
Oct 31, 2026
Merged

altugank merged 3 commits into
codician-team:mainfrom
alankernel67:claude/skip-docker-e2e-on-forks

Conversation

@alankernel67

@alankernel67 alankernel67 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Intent: pull requests from forks should run CI on Diffinery's own GitHub runners (runs-on: diffinery), like main and upstream branches do, instead of on GitHub's ubuntu-24.04.

Every job picks its runner with ${{ vars.DIFFINERY_RUNS_ON || 'ubuntu-latest' }}. GitHub passes no repository variables to workflows of pull requests from forks, so on those (for example #21) every job ran on GitHub's runners, and "End-to-end (runner Docker)", which needs Diffinery's docker wrapper, always failed.

  • Every runs-on in .github/workflows is now ${{ vars.DIFFINERY_RUNS_ON || (github.repository == 'codician-team/diffinery' && 'diffinery') || 'ubuntu-latest' }}. In this repository a fork's pull request gets diffinery. The variable still overrides it (set it to ubuntu-latest to deploy while Diffinery can't start runners), and other copies of the repository keep ubuntu-latest, so their CI doesn't wait for a runner that never comes.
  • "End-to-end (runner Docker)" is no longer skipped for forks: it runs on Diffinery's runners like the rest. (The first commit skipped it; the second replaces that.)
  • Docs: CONTRIBUTING.md, the comments in ci.yml and deploy.yml, the DIFFINERY_RUNS_ON row in docs/self-hosting/deploy.md, and docs/actions/github-runners.md, which now shows other projects how to run their fork pull requests on Diffinery with the same expression.
  • test/unit/contact.test.ts: a test that failed about half the time on fast runners, because two messages sent in the same millisecond had their order decided by random ids, now checks them by message instead of by order. It failed "Unit tests (1/2)" here.

For maintainers: fork pull requests now use the linked account's Diffinery minutes. As GitHub runners → Security advises, keep Settings → Actions → General → Require approval for fork pull request workflows on for outside contributors. Each job still gets a new container and a just-in-time runner, and fork pull requests still get a read-only token and no secrets.

This changes files under .github/workflows, so it needs a maintainer to merge.

How it was tested

This pull request is itself from the alankernel67 fork, and GitHub runs pull request workflows from the pull request's version of the files: its jobs should land on diffinery-… runners, and "End-to-end (runner Docker)" should run and pass instead of failing on its hosted-runner check.

Checklist

  • pnpm -r typecheck and pnpm -r test pass (no code changes)
  • User- or admin-visible changes update the docs in apps/diffinery/docs
  • New D1 migrations use the next free number in apps/diffinery/migrations (none)

On behalf of Alan Kernel (@alankernel67).

GitHub passes no repository variables to fork pull requests, so DIFFINERY_RUNS_ON is
empty there and the job lands on GitHub's ubuntu runner, where its check for Diffinery's
docker wrapper fails every time. Skip the job for forks; upstream branches and main still
run it, with the check unchanged. CONTRIBUTING.md says how a maintainer runs it.
@alankernel67
alankernel67 force-pushed the claude/skip-docker-e2e-on-forks branch from 7581ba0 to bc42669 Compare October 31, 2026 11:18
GitHub passes no repository variables to pull requests from forks, so DIFFINERY_RUNS_ON
was empty there and every job fell back to ubuntu-latest on GitHub's own runners. In
codician-team/diffinery, default the label to `diffinery` instead; the variable still
overrides it, and other copies of the repository keep ubuntu-latest. With that the
runner Docker job runs on fork pull requests too, so it no longer needs skipping there.
@alankernel67 alankernel67 changed the title Skip the runner Docker e2e job on pull requests from forks Run fork pull requests' CI on Diffinery's runners, not GitHub's Oct 31, 2026
…ame millisecond

Both rows can get the same created_at, and then their random ids order them, so the test failed about half the time on fast runners (Unit tests (1/2) on this pull request).
@altugank
altugank merged commit b090fe4 into codician-team:main Oct 31, 2026
10 checks passed
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.

2 participants