workflow expression
Text inside ${{ and }} in a workflow file that GitHub evaluates before a step runs, such as ${{ github.sha }}.
In more detail
Expressions read contexts, compare values and call functions such as hashFiles and fromJSON. The result is substituted into the file before the shell starts, so the shell only ever sees a finished string. Putting untrusted event text straight into a run script this way can allow script injection, so pass it through env instead.
Related terms
- workflow context — A named object, such as steps, needs, matrix, secrets or runner, that expressions read to get facts about the current run.
- hashFiles — A workflow expression function that returns one SHA-256 hash for the files matching a pattern.
- fromJSON — A workflow expression function that turns a JSON string into a real value, such as a list for a matrix.
- env key — The workflow key that sets environment variables for every step of a workflow, a job, or a single step.
Taught in
- Workflows, Jobs, Steps, and Actions — Continuous Integration & Continuous Delivery Pipelines
- Triggers and the Event Model — Continuous Integration & Continuous Delivery Pipelines
- Scaling with Matrix Builds — Continuous Integration & Continuous Delivery Pipelines
- The Workflow That Ran On A Stranger's Pull Request — GitHub Actions (GH-200) Exam Prep
- Workflow Structure: Jobs, Env, Services, Commands And Anchors — GitHub Actions (GH-200) Exam Prep
- Expressions, Contexts And The If That Is Always True — GitHub Actions (GH-200) Exam Prep
- Script Injection: When An Issue Title Becomes Code — GitHub Actions (GH-200) Exam Prep
- YAML-Reading Sprint: What Happens When This Runs? — GitHub Actions (GH-200) Exam Prep
- Full Mock And Review: Where Your Points Go — GitHub Actions (GH-200) Exam Prep