Repository navigation
feat(runner): forge-runner, a self-hosted CI runner on nektos/act (I-4) - #157
Merged
Merged
Conversation
…lows, report via dg ci Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ide, local e2e Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…hallow fetches), GITHUB_SHA in jobs Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…no key in jobs Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… per-run caches and dirs Workflows are parsed before act: container/services options and volumes and reusable workflows are refused (one failed check each) unless allowed per repo; invalid YAML is a failed check; on.push branch/tag/path filters decide which files run, one act run per file. act runs with a cleared environment, an explicit empty GITHUB_TOKEN, no cache server and a per-run action cache; -self-hosted platforms are refused; runs are locked per repo in their own directory; a timed-out act gets SIGINT then SIGKILL and, on a runner-owned daemon, a sweep of act-* objects; run ids are hashed; failed starts retry. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… runner enforces, as built Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… services; refuse expressions there Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… parsers disagree on <<) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ogs, document credentials and .actrc limits Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedNext included review available in 8 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…de_json preserve_order varies by build) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I-4 of the CI track (platform-parity-spec §2.4, §2.5, §2.8, Group I):
forge-runner, a self-hosted CI runner built on nektos/act. It is the "fork of the GitHub runners stack" option: it does not write a new runner. It drives act, git withgit-remote-dash, anddg ci report(from #148). It has no forge-core or Platform SDK dependency.What it does
git ls-remote dash://<repo>everyinterval_secs(at least 30 s) and keeps per-repo tip cursors in the state dir. The first poll only records the tips; a restart re-runs nothing.refs. It fetches into a per-repo bare cache (dash:// refuses shallow fetches, E205), then clones that into a fresh per-run directory held under a per-repo lock..forge/workflows/*.y*mlitself (yaml_serde) before act:on.pushrules:branches,tags,pathsand their-ignoreforms, with!negation;-W <file>).dg ci report:--external-idper job keeps each job to a single check run;<workflow> / <job>.--log --storage <profile>. Logs are capped at 16 MiB and secret values are redacted first. The web app verifies the log against thelogSha256on chain.attempts.forge-runner run <repo> --ref … --sha …re-runs one commit by hand.runneruser that owns the state dir.Security
The boundary is the Docker daemon the runner is given, and the guide says so. On top of that, the runner enforces the following.
Workflow content is checked before act runs:
image,env,portsandcredentialsmay appear incontainerorservices.*. Everything else is refused, includingoptionsandvolumes, and anything a newer act might add.${{ }}incontainerorservices. act interpolates these at run time:container: ${{ matrix.c }}would carry options past a static check. This was verified against act 0.2.89.jobs.*.usesis refused. A per-repoallow_container_optionslifts the container, services and uses rules; it defaults to false.<<:, so a workflow that uses one does not run.runs-onlabels run. A label missing from[platforms]is refused rather than falling back to act's old default images.^[A-Za-z_][A-Za-z0-9_-]*$) before they are used in any path. Refused jobs become failed checks with the reason. act gets a filtered copy of the workflow, written outside the checkout.act itself runs locked down:
env_clear(), then an allowlist of PATH, HOME, TMPDIR, USER, LANG, TZ,DOCKER_*andXDG_*.DASH_FORGE_KEYnever reaches act or a job.--container-daemon-socket -), and jobs join the bridge network, not the host's.GITHUB_TOKEN: always passed as-s GITHUB_TOKEN=, empty unless the ref is trusted. act therefore never falls back to the host's gh token.trusted_refs, which match nothing by default. Fork PRs never run: only pushes to the watched repo's own refs do./dev/nullis passed for--env-file,--var-file,--input-fileand (when untrusted)--secret-file. A committed.actrcis ignored because act never runs with its working directory in the checkout; the guide notes this.--no-cache-server, plus a per-run--action-cache-path.-self-hostedplatform is refused in the config.sweep_after_timeout(only on a runner-owned daemon), everyact-*container, volume and network is removed, andact-toolcacheis reset before each run.Docs:
docs/guides/self-host-runner.md: setup, a compose file with a TLS dind on port 2376 (never 2375, never the host socket), a Security section describing what is actually enforced, and the current limits.docs/guides/ci.mdgains a "Self-host a runner" section.Review
.actrcnote is added, and invalid-UTF-8 logs are kept.Tests
-self-hostedand secrets only for trusted refs;ls-remoteparsing and cursors;GITHUB_TOKEN, no cache server,/dev/nullfiles;uses, expressions, unknown keys, merge keys, labels;on.pushfilters, the filtered workflow copy, and symlinked workflow files;crates/forge-runner/tests/e2e-local.sh): real act and Docker, a local git remote, and a recordingdg. PASS, 25/25. It covers:GITHUB_REFandGITHUB_SHA;.actrcand.secretsignored;container.optionsjob and auses:job refused and never run, and an invalid file reported as one failure;branches: [main]workflow skipped on a feature branch;act-*container left behind.ci-smoketest repo, owned by a freshly minted identity. forge-runner used the realdash://checkout, act anddg ci report. One check run went queued → in_progress → completed withsuccess, and the job printed its realGITHUB_SHA. The log went to local RustFS with itslogSha256, and the run was trusted.Not in this PR
pull_request, schedule and dispatch events.🤖 Generated with Claude Code