Expressions and values
Expressions are CEL. if: and vars: are expressions as written; every other string field takes a template, ${{ … }}, whose value is put into the string. Expressions are type-checked when the pipeline compiles. There is no ${{ }} in run:: values reach scripts only through env:.
What an expression can read
Functions
has(event.pull_request)tests whether a field is set. Reading a field that isn't set is an error when the expression runs.changed("src/**", "go.mod")is true when a changed file matches one of up to ten patterns (the rules ofcache.inputs), and when Hod doesn't know what changed: tags, manual and scheduled runs, andhod local runwithout--changed. Its arguments must be string literals.event.semveris set for tags that are versions: an optional prefix ending in/or@, an optionalv, then a semantic version.- The CEL
stringsandbindingsextensions are on:s.startsWith("x"),s.split("/"),list.join(","),cel.bind(…). - An expression too costly to run (over 1,000,000 cost units, by its estimate) is rejected when the pipeline compiles, and evaluation is bounded at run time.
Values Hod gives you
In expressions the event is event, and in every step's environment Hod sets the variables in the last column:
Steps also get CI=true, HOD=true, HOD_JOB, HOD_RUN_ID, HOD_RUN_ATTEMPT, HOD_WORKSPACE, HOD_OUTPUTS (the directory a step writes its outputs to), HOD_SECRETS (the directory holding the step's granted secrets, one file each) and, for a step granted identity, HOD_IDENTITY_TOKEN_FILE. Hod's own variables (HOD and the HOD_* names in this section) can't be set in env:; other names, such as HOD_SERVER for a job that calls hod, can.