GitHub Actions Expressions
Written like:
yaml
env:
SOME_INT: ${{ 123 }}
SOME_FLOAT: ${{ 123.123 }}
SOME_HEX: ${{ 0xff }}
# Strings contained in expressions are single-quoted
SOME_STRING: ${{ 'It''s-a me!' }}
Truthiness matches exactly with JavaScript.
Conditional expressions
jobs.<job-id>.if
takes in an expression which evaluates to a boolean.
You can omit the usual $
for if
blocks, as GitHub Actions will always parse the value as an expression by default.
However, you need to keep it if using !
, since that is a reserved token for YAML.
See the documentation on conditions controlling job execution
Contexts
A context is an object containing key/values who are automatically populated with information about the jobs being run.
For example, the github
context contains information about:
- the actor (user) who started the action (
github.actor
) - the repository being acted on (
github.repository
) - the fully formed git ref name (
github.ref
) - the short ref name (
github.ref_name
)