Docs / Collaborate
CI and check runs
Forge has no CI service of its own. Any CI can report results on Forge: GitHub Actions, GitLab CI, a shell script on your laptop, or a runner you host. It writes check runs, small on-chain documents that say "check build on commit 5950173 passed", and the web app and dg show them on the commit page, on a pull request's Checks tab and in the merge box.
Every check run is signed by an identity the repository trusts. Nothing is trusted because of where it came from:
- Consensus checks the writer. Platform accepts a
checkRunonly from a current runner, maintainer or writer of the repository. It refuses anyone else's with code 40120. - Readers check again. A run counts only while its reporter still holds that role. Revoke a runner, and its runs are still listed but no longer count ("reporter is no longer a member or runner: not counted").
- A runner key can sign nothing else.
dg ci runner newregisters a key bound to thecheckRundocument type, with a budget and an expiry. If it leaks, it can only post check runs, only to repositories where its identity is a runner, and only until the budget or the expiry ends.
The design is in platform-parity-spec §2.
Enrol a runner
A runner is an identity of its own. Mint one for CI with dg auth new --backup-file runner.json and a small deposit, since it pays for its own reports. Do this on your own computer, not in a CI job. dg auth new makes the new identity this computer's default, so sign back in as the repository owner (dg auth login <your identity file>), or pass --identity for the next command. Then, as the owner:
dg ci runner new alice/project --runner runner.json -o runner.dfk1 \
--identity ~/owner.identity.json # only if you did not sign back in as the ownerThis does two things:
- Registers a key on the runner identity, signed once with the runner's master key from
runner.json. The key is AUTHENTICATION / HIGH, bound to(forge-collab, checkRun), with a 0.5 DASH budget and a 365-day expiry (--budget,--expireschange them). - Enrols the identity as a runner of
alice/project: a forge-corerunnerdocument that only the owner can write.
The key is written to runner.dfk1 (0600, unencrypted) before it is registered, so a key that nobody holds is never registered. Put the file's contents in your CI's secret store as DASH_FORGE_KEY, then delete the file.
Secrets never go to a log. dg prints a secret it made only on a terminal, and never in --json output or when a CI variable (CI, GITHUB_ACTIONS, …) is set. Anywhere else it writes the secret to a new file you name (0600; an existing file is refused), prints only the path, or refuses before it creates anything:
| Secret | In a terminal | Scripted, piped or in CI |
|---|---|---|
Recovery phrase (dg auth new) | shown once, then the three-word check (--skip-backup-check skips only the check, and needs --backup-file) | only in --backup-file <new file>, sealed under DASH_FORGE_PASSPHRASE (unsealed with --reveal-secrets); refused without it |
Runner key (dg ci runner new, dg auth export) | only in a new file (-o); only the path is printed | the same |
Webhook secret (dg webhook add) | shown once | only in --secret-file <new file>, or your own via --secret-env; refused without either |
dg auth export --format dfk1 --reveal-secrets -o - prints this computer's limited key on stdout, for piping straight into a secret store (| gh secret set DASH_FORGE_KEY). That key can sign any Forge document within its budget; it is not a runner key, so use dg ci runner new for check runs. It is refused with --json and when a CI variable is set. Never run it where stdout is a log.
In a terminal, a passphrase-sealed key and a sealed runner.json are each asked for. In a script, DASH_FORGE_PASSPHRASE opens your key and DASH_FORGE_RUNNER_PASSPHRASE opens runner.json (it falls back to DASH_FORGE_PASSPHRASE); a wrong one is E303 naming the file.
dg auth status and dg doctor with the runner key describe it as bound to checkRun documents only (a CI runner key), with its budget and expiry.
Other commands:
| Command | Does |
|---|---|
dg ci runner add <repo> <identity> | enrols an identity that already has a key (one you keyed yourself); <identity> is an id or a DPNS name |
dg ci runner list <repo> | lists the repository's runners |
dg ci runner revoke <repo> <identity> | deletes the membership; the runner's next report is refused at consensus, and its old runs stop counting |
Without --runner, dg ci runner new puts the key on your own identity (it asks for your master key once). As the owner you are a maintainer, so no enrolment is needed. That suits a single-developer setup, but it gives up the separate identity.
Report a check run
export DASH_FORGE_KEY="$(cat runner.dfk1)" # in CI: from the secret store
SHA=$(git rev-parse HEAD)
dg ci report alice/project --sha "$SHA" --name build --status queued \
--details-url "https://ci.example/runs/42"
dg ci report alice/project --sha "$SHA" --name build --status in_progress
dg ci report alice/project --sha "$SHA" --name build --status completed \
--conclusion success --summary "412 tests passed" --log build.log --storage my-r2- The network comes with the key. A
dfk1:key records its network (dfk1:testnet:…), anddguses it when nothing else names one, so a fresh CI machine needs no--networkflags. In a checkout of adash://clone, the network the clone pinned wins;DASH_FORGE_NETWORKtakes the same formdgprints (testnet, ordevnet-<name>for a devnet). - The first report creates the run; the next ones update it in place. An update is a replace of your own open run with that name on that commit. Once a run is
completed, reporting the same name again (without--external-id) starts a new run, a re-run, which becomes the run shown;dgsays so before you confirm. --external-id <your CI's run id>ties reports to one run: a report updates the run carrying that id while it is open, and never starts a second one for it. Once that run completed, the same result again changes nothing, and a report that would change it (another conclusion, or a status that starts it over) is refused with E604 before anything is signed: a completed run is final, so report a re-run with a new id. If no run carries the id yet,dgreads once more a few seconds later before it creates one, so a report sent right after the first does not split the run. Use it whenever your CI has a run id (the GitHub Action passesgh:<run id>:<attempt>:<job>:<name>).- What an update keeps. A field the report does not give keeps its stored value. The start time, the completion time and the conclusion are set once and never move, so a re-queue (
--status queued) of a run that started is a new run (or, with--external-id, refused with E604). --statusisqueued,in_progressorcompleted. A completed run needs a--conclusion:success,failure,neutral,cancelled,skipped,timed_out,action_requiredorstale(GitHub's set).dgrefuses a wrong combination before it signs anything, and so does the contract.--log <file>uploads the log to your storage profile (after you confirm the report). It is content-addressed, the same way a release asset is (see Bring your own storage), and the run records the log's URL and SHA-256. The web app downloads the log from your bucket and shows it only if its bytes hash to the recorded SHA-256; otherwise it says the bytes are not the reported log. Log bytes never go on Platform. The bucket needs CORS for the web app's origin, like any bucket the browser reads.--artifact <file>(repeatable, at most 10) uploads a file the run produced to the same storage, content-addressed, and records it in the run'sartifacts: its name, size, SHA-256 and URL, in the shape of a release's assets. The field holds 4,096 bytes, about a dozen entries; one that does not fit is uploaded but not recorded, with a warning. The web app lists them on the Checks tab and saves one only if its bytes hash to the recorded SHA-256, as it does a release asset. Archive a directory into one file first (forge-runner zips eachactions/upload-artifactartifact).--summary(or--summary-file) takes up to 1,000 characters.dgprints the commit's web page, where the run shows up.
dg ci status alice/project <sha> (or --sha <sha>, as dg ci report takes it) lists one run per name on a commit. Inside a clone the commit can be anything git rev-parse takes (HEAD, a branch, an abbreviated id), and dg ci status alone reads the clone's HEAD; dg ci report --sha takes the same forms. It lists the newest run by a current member or runner, which is the one a merge counts (unless the branch policy pins that check to another source: the run is then marked as not counted, and dg ci report warns before reporting it). A newer run by anyone else is not shown in its place. dg pr checks alice/project <n> does the same for a pull request's head, and also lists each check the branch policy requires that no counted run decides (? build expected (required from …)). Like gh pr checks, it exits 1 (E104) when a counted or required check failed, and 8 (E804) while a required check is missing or pending, so a CI gate can run it.
For each name, the newest run by ($createdAt, $id) among runs by current members and runners decides. A branch policy with requireChecks needs every such run on the head to pass (success, neutral or skipped), and at least one to exist; a policy that names required checks needs each named one to pass, requireChecks or not. To name the required checks from the command line, dg repo policy set <owner>/<repo> --required-check build --required-check lint (repeat it per check; --required-check build=@ci-runner pins a check to the runner or maintainer whose runs count, and then every check needs one). The web merge box and dg pr merge apply the same rule; a maintainer can bypass it ("bypass rules" in the web, --override-policy in dg), and the bypass is recorded on the PR as an event nobody can delete.
Re-run checks
A maintainer or writer can ask the repository's runners to run a pull request's checks again, as GitHub's "Re-run" does:
- In the web app, on the PR's Checks tab: Re-run beside a completed check reported by forge-runner, or Re-run all checks. The tab then shows "Re-run requested" until a newer run of that check is reported, to everyone, and reads the runs again every 30 seconds meanwhile. A request no run answers within 10 minutes (no runner took it: runners handle each request once) says "no run yet" and Re-run is offered again. A run left queued or in progress for 2 hours (its runner stopped mid-job) is offered too.
- From the command line:
dg ci rerun alice/project 12for every check, or--check "ci / build (pull_request)"for one (dg pr checkslists the names).--sha <commit>refuses the request if the PR's head is no longer that commit.
A request is one event on the PR (kind 26, forge-v2.md §3.3), which no one can delete: 59,660,580 credits (about 0.0006 DASH) for one check on a Platform v5 devnet (2026-10-02, Platform 5.0.0-beta.1); dg and the web app show an upper bound before you sign. It names the PR's head, the repository (so runners find it with one query) and the check. forge-runner reads the requests on every poll, or within seconds when the owner's relay wakes it, and runs the workflow that reports the check again on the head; the new run replaces the one shown. dg ci reruns alice/project [--since <ms>] lists the requests and whether each counts.
- Who can ask. The owner, maintainers and role-1 writers. Platform also admits a triage member's request (the contract's
t_triageKindsdoes not name kind 26), but no reader counts it:dgand the web app refuse it before signing, and runners ignore one. - What can be re-run. An open PR's current head only: runners run nothing for a head that moved. Checks reported from elsewhere (the GitHub Action, a script) are re-run there; the web app offers Re-run only on forge-runner's runs.
Members-only branches
A check run is public: anyone reads its commit, name, status and conclusion. On a members-only branch (dg branch new --members, private-repos §19) a run must not show the branch's commit, its check names or its log, so it is reported differently (private-repos §19.9):
- Reporting.
dg ci report alice/project --members-branch sec/fix --sha <commit> --name "ci / build" --status completed --conclusion success --log build.log --storage ci-logsreports on the commit's blind (the value the branch's update shows the public instead of the commit) under a 16-character name only members can read. The run carries no summary, details link, run id or artifacts. The log, or without--loga short one naming the check, is uploaded so that only members can open it; the public can fetch it but reads nothing. You need your encryption key and the members key (a member's identity file, not a runner key). forge-runner does this for you withmembers_branches = true. - Reading, as a member.
dg ci status alice/project <commit>lists the runs of a members-only branch's commit by their real names, marked members-only.dg ci log alice/project <commit> "ci / build"prints a run's log (-o <file>writes it), for any run, public or members-only. - Reading, as anyone else. The runs show under their 16-character names on the blind, with their outcomes; nothing names the branch or the commit.
- Pull requests. A members-only pull request from a members-only branch shows its runs in its Checks as for any PR (they are reported on the head it shows); members read their names.
What it costs
Measured on devnet bonsia (2026-09-30, drive 4.2.0-beta.7; 1 DASH = 10¹¹ credits):
| Write | Who pays | Credits | DASH |
|---|---|---|---|
| Register the runner key (identity update) | the runner | 43,008,000 | 0.00043 |
Enrol the runner (runner document) | the owner | 47,298,000 | 0.00047 |
First report of a run (checkRun create) | the reporter | 81,508,000 – 95,093,000; a repository's first 121,929,000 | 0.00082 – 0.00095; the first 0.00122 |
| Each later update (replace) | the reporter | 4,651,000 – 5,546,420 | ≈ 0.00005 |
The create's price depends on the fields it carries (a details URL, a summary, artifacts, a log's URL and hash), and a repository's first check run pays more: it opens the check-run indexes. A typical run is one create plus two updates, about 0.001 DASH, so a 0.5 DASH runner key covers roughly 500 runs. The log itself costs nothing on Platform: it goes to your bucket. On devnet moutai (drive 4.2.0-beta.6, 2026-09-29) the same writes cost less: the key 0.000285, the enrolment 0.000458, a create 0.00055–0.00078 (0.00059 with --log) and an update ≈ 0.000035 DASH.
Before it signs, dg shows an upper bound over these numbers: 0.0005 DASH for the key, 0.00055 for the enrolment, 0.0013 for a create and 0.00008 for an update, plus 27,700 credits (0.000000277 DASH) per byte of the text the report carries (name, details URL, summary, external id, artifacts; a log adds its URL and hash). The contract admits up to ~7 KB of that text, so a report with a full summary, artifacts and a log is quoted up to ~0.002 DASH more. It reads the commit's runs first, so the prompt names the write that will happen (create or update). After the write it prints what was actually charged.
Security
- Keys. Give CI a runner key, never your identity file: the file holds your master key. The runner key's bounds are enforced by consensus. Anything else it signs is refused with
ContractBoundedKeyOutOfBoundsError(20014), whichdgreports as E302 before anything is broadcast. The key cannot register keys, move credits or write any other document type. The budget and the expiry cap the damage from a leak.DASH_FORGE_KEY=runner.json dg auth keys disable <id> --master runner.jsonretires the key early (it signs as the runner identity, whose key it is), anddg ci runner revokeremoves the identity's standing on the repo. - What a runner can do. It can write check runs on any commit id of the repositories it runs for, including commits that are not in the repository. Readers match runs to commits by id, so a run on a stranger's commit shows nowhere. A runner cannot edit or delete another identity's run.
- What is public. Check runs are plaintext on chain: name, status, summary, details URL, log URL. See private-repos §7. Do not put secrets or private code in summaries.
- Check runs of a private repository. forge-community refuses a private repository's run that carries a summary, details URL, log, artifacts or external id.
dg ci reportleaves them out with a warning and records only the name, status, conclusion and times;--logand--artifactfiles are not uploaded, and--public-logno longer does anything. Without an external id, a report updates your open run of the same name on that commit, so two jobs that report the same name on the same commit at once (a push and a pull request run, or two branches) share one run: give them different names. The check's name stays public, so do not put secrets in it. - URLs.
--details-urlmust behttps://(an IP host is accepted, unlike a webhook URL — see Webhooks and CI). A log's storage must record an https address (an S3 bucket's httpspublic_url) or anipfs://one:dgrefuses a plain-http or private bucket before uploading. - A home-NAS or self-hosted log server needs TLS before you can use
--logat all.dg ci report --logchecks the storage profile'spublic_urlfirst and refuses, before uploading anything, if none of the profile's targets record an https oripfs://address ("the log's storage gives no https or IPFS address"). If your storage is a self-hosted MinIO, a NAS's built-in S3 endpoint, or anything else on your own network (see Bring your own storage and the home-NAS storage guide), put a real TLS terminator in front of it on a domain you control — a named Cloudflare Tunnel, or a reverse proxy such as Caddy — and only then rundg storage add … --public-url https://…(or edit an existing profile) to record that https address. A Tailscale-only name doesn't help here: it isn't reachable by a browser outside your tailnet, so a log linked from a public check run would not load for anyone else, the same reason it is refused for pack storage (Public addresses). Claiming an httpspublic_urlfor a bucket that is actually still serving plain http breaks the same way: the web app fetches the literal recorded URL, and every reader's browser refuses that fetch, not just yours. - Reading a log in the browser. The web app fetches a log only over https (plain http only from a page served on the same machine, for local tests), without cookies or a referrer, gives up after 30 seconds, and stops reading at 32 MiB.
- Verifying a log or an artifact. The SHA-256 on chain pins the bytes. Whoever controls the bucket can delete a log or an artifact, but cannot swap it for another without the web app noticing. Artifacts are as public as logs: anyone can download them from the bucket.
Limits of the current contract
These are what the protocol and the current forge-collab contract allow. They are verified against Platform v4.2.0-beta.6.
- A key can be bound to
checkRunonly. Protocol 14 admitsSingleContractDocumentTypebounds on AUTHENTICATION keys (validate_identity_public_key_contract_boundsv2), and consensus enforces them per batch member (ContractBounds::check_batched_transition). - The contract does not say which identity may report, beyond "runner, maintainer or writer". It cannot require that only runners write
checkRun, and it has no status-transition rule, such as "noqueuedaftercompleted". The one rule it has is that a conclusion is present exactly when the status iscompleted. Clients follow the newest-run rule. ci-contract-wishes.md lists what the next registration should add. - A check run is not tied to a pushed commit. Consensus cannot check that
headOidexists in the repository: packs live off-chain.
Self-host a runner
forge-runner watches a repository, runs .forge/workflows/*.yml (GitHub Actions syntax) with nektos/act in Docker on every push and pull request, and reports each job through dg ci report with its log. It polls; your own relay can wake it within seconds of a push.
The security boundary is the Docker daemon you give the runner. Give it a daemon of its own: rootless, sysbox, or a Docker-in-Docker sidecar over TLS. Never the host's socket. On top of that, the runner:
- Refuses workflow options that reach past the container. A job that sets docker options or mounts (
container.options/volumes, the same onservices), or calls a reusable workflow, is refused unless the repository allows it. - Keeps the daemon's socket out of jobs, and puts jobs on the
bridgenetwork, not the host's. - Hands secrets and a
GITHUB_TOKENto trusted refs only. Other runs get an empty token, and secret values are redacted from logs before upload. - Gives a job its
environment:'s values only on a trusted run, only when the environment is shared with the runner's identity by name, and only to the jobs that name it (Environments). - Clears act's environment, so
DASH_FORGE_KEYnever reaches act or a job, and ignores act configuration planted in the checkout. - Follows GitHub's fork-PR model: a pull request runs with the secrets only when its head is a trusted branch of the repository itself and its author the owner or a maintainer; a fork's or a non-member's PR runs with no secrets and an empty token, and by default a non-member's PR does not run at all (Pull requests).
Self-host a CI runner has the details.
Report from GitHub Actions
A repository mirrored from GitHub keeps its CI on GitHub. The check action reports each GitHub job's result as a Forge check run on the same commit (a mirror is the same git history, so the commit ids match; a pull request run reports on the PR head):
- name: Report to Dash Forge
if: always()
uses: PastaPastaPasta/dash-forge/check-action@v0.2.0 # installs the v0.2.0 dg
with:
repo: <owner identity id>/project
job-status: ${{ job.status }}
network: testnet # Forge runs on testnet (the default)
env:
DASH_FORGE_KEY: ${{ secrets.FORGE_RUNNER_KEY }} # from `dg ci runner new`Pinned to a release tag, the action downloads that release's checksum-verified dg in seconds, on Linux and macOS runners. To run code that is not in a release, pin a commit you have reviewed and set install: 'source': the action then builds dg from its own source, the ref after @ in uses:. That works on Linux runners only and takes a few minutes in every job that reports, so report from one Linux leg, or from one summary job that needs: the others. The check action's README has the details. The check is named <workflow> / <job>, and each matrix leg is its own check. The check run's details link goes back to the GitHub run. A failed report warns and passes by default, so a Forge outage never fails your CI. A pull request from a fork has no access to the secret and does not report: do not use pull_request_target to give it one.
This page is docs/guides/ci.md from the Dash Forge repository, as of this build. View or edit it on GitHub