For AI agents: the complete documentation index is available at https://docs.hod.sh/llms.txt, the full documentation bundle is available at https://docs.hod.sh/llms-full.txt, and this page is available as Markdown at https://docs.hod.sh/reference/pipeline.md.

Pipeline reference

A pipeline is the YAML file .hod/pipeline.yaml at the root of a repository. This page lists every key the format has, with its type and default; the Writing pipelines pages explain them, with examples. The format is version 0. Editors can complete and check pipelines with the format's JSON Schema (Editor support).

Rules for every key

  • Unknown keys are errors. hod validate reports each with its file:line:col, and suggests the key you probably meant.
  • Keys planned but not built yet (listed in Not in v0 yet) fail with not supported in v0 yet.
  • Expressions are CEL. if: and vars: are expressions as written; every other string field takes a template, ${{ … }}. They are type-checked when the pipeline compiles (Expressions and values).
  • No ${{ }} in run:. Values reach scripts only through env:, as variables.
  • Quote a value that starts with {, [ or !, or that contains : (a CEL ternary, say). Single quotes keep CEL's double-quoted strings as they are: '${{ vars.ok ? "a" : "b" }}'.
  • Durations are written like 90s, 30m, 1h30m or 2d.

Top level

KeyTypeDefault
version0(required)The format's version
onlist or map(required)Which forge events start runs (Events)
varsmap of expressionsNamed values computed once per run (Named values)
concurrency{group, policy}a group per pull requestHow runs of this pipeline share a group (Concurrency)
jobsmap of jobs(required)The jobs, by name (Jobs)

on: is a list of event names or a map from names to filters: push takes branches and tags, pull_request takes branches (the base branch). Filters are globs on the name, where * doesn't cross /.

Jobs

KeyTypeDefault
imagetemplatethe runner's default imageThe container image the job runs in (Jobs and steps)
runs-onlist of templatesany runnerLabels the runner must have
needslist of job namesJobs that must end first (Order)
ifexpression (bool)trueWhether the job runs (Conditions)
envmap of templatesVariables for every step
stepslist of steps(required)What the job runs (Steps)
cachelist of presets or {paths, key_files}Dependency caches (Caching)
freshboolfalseBuild from scratch, with no cache (Caching)
dockerboolfalseA Docker daemon of the job's own (Docker in a job)
servicesmap of servicesContainers beside the job (Services)
matrixmap or list of mapsRun the job once per combination (Matrix)
fail_fastboolfalseWith matrix: a failed instance cancels the others
max_parallelintWith matrix: at most this many instances at once
concurrency{group, policy}One member of the group at a time (Concurrency)
timeoutduration6h (the server's HOD_JOB_TIMEOUT)How long the job may run (Timeouts)
retryint or list of {when, exit_codes, max}Run a failed job again (Retries)
allow_failuretrue or {exit_codes}falseA failure doesn't fail the run (Allowed failures)
secretslist of names or {name, env}Secrets for every step (Secrets)
identity{audience} or list of {name, audience}OIDC tokens for every step (Cloud identity)
guardslist of {uses, with}Components that run for the whole job, such as an egress guard
usescomponent referenceMake the job from a template (Components)
frompath or list of pathsMake the job a group of jobs from files under .hod/jobs/ (Job groups)

A job with uses takes only uses, with, needs, if, matrix and secrets. A job with from takes only from, needs, if and matrix.

Inside a job's keys

KeyInTypeDefault
pathscachelist(required)Directories to keep
key_filescachelist of globsFiles whose contents make the key
groupconcurrencytemplate(required)The group's name
policyconcurrencybuffer_all, buffer_one, skip, cancel_other, allowbuffer_allWhat a new member does when the group is busy
whenretrylist of failure, timeout, errorall threeWhich endings the rule retries
exit_codesretry, allow_failurelist of intsOnly failures of a step that exited with one of these
maxretryint2More attempts this rule allows, at most 10

Steps

KeyTypeDefault
runstringThe script. One of run and uses
usescomponent referenceA step component (Components)
withmap of templatesThe component's inputs
namestringthe script's first lineShown in logs, the UI and the API
ididentifierLets later steps read steps.<id>.outputs and steps.<id>.result
dirpaththe workspaceWorking directory, relative to the workspace
envmap of templatesVariables for this step, over the job's
ifexpression (bool)trueWhether the step runs
cache{inputs}The step cache: skip the step when its inputs didn't change (Caching)
fileslist of pathsFiles or directories passed to the jobs that need this one (Files)
outputsmap of string, bool, int, list(string)Typed values the step writes, one file each (Outputs)
pushlist of ref globsRefs the step may push to (Pushing)
timeoutdurationthe job'sHow long the step may run
allow_failuretrue or {exit_codes}falseThe step's failure doesn't fail the job
secretslist of names or {name, env}the job'sSecrets for this step
identity{audience} or list of {name, audience}the job'sOIDC tokens for this step

Services

name: image is short for {image: …}. See Services.

KeyType
imagetemplate(required) The service's image
envmap of templatesIts variables
commandlistArguments; replaces the image's CMD
entrypointlistReplaces the image's ENTRYPOINT, and drops its CMD
portslist of intsPorts to wait for
readystring or {run, timeout}A script, run in the service with sh -c, that exits 0 once the service is ready; timeout is 60 seconds by default

Limits

Patterns in changed()10
Matrix instances per job256
Jobs per pipeline, after matrices512
Group files per pipeline64
One group file1 MiB
Attempts one retry: rule adds10
One output's value16 KiB
A job's outputs64 KiB
A secret's valueat least 8 bytes
A job's timeout: without one6 hours (the server's HOD_JOB_TIMEOUT)
A service's readiness60 seconds, unless ready: {timeout}

Not in v0 yet

These keys fail with not supported in v0 yet:

  • at the top level: inputs, registries;
  • in on:: manual, api;
  • on a job: environment, resources, checkout, post;
  • on a step: reports, annotate, image.

Also not built yet: paths filters in on: (use changed() in if:), matrices built from a job's outputs, and services for a single step.