Skip to content

Harden label_new_issues-remove_label against template injection - #268

Draft
staticaland with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-template-injection-label-new-issues
Draft

Harden label_new_issues-remove_label against template injection#268
staticaland with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-template-injection-label-new-issues

Conversation

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown

Description

The cleanup workflow for new issues interpolated ${{ ... }} directly inside run:, which is an unsafe pattern. This change moves workflow expressions into step-level env: and uses shell variables in the script body.

  • Scope
    • Updated .github/workflows/label_new_issues-remove_label.yml only.
  • Hardening change
    • Added:
      • REMOVE_LABEL_ON_ALL_ISSUES: ${{ github.event.inputs.remove_for_all_issues }}
      • DATE_INPUT: ${{ github.event.inputs.date }}
    • Removed inline assignments using ${{ ... }} from run:.
  • Resulting pattern
    • Script now reads only environment variables, avoiding expression interpolation in shell code.
- env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    REMOVE_LABEL_ON_ALL_ISSUES: ${{ github.event.inputs.remove_for_all_issues }}
    DATE_INPUT: ${{ github.event.inputs.date }}
  run: |
    echo "remove_for_all_issues: $REMOVE_LABEL_ON_ALL_ISSUES" >> "$GITHUB_STEP_SUMMARY"
    echo "date: $DATE_INPUT" >> "$GITHUB_STEP_SUMMARY"

Motivation and Context

This addresses template-injection risk in the workflow by applying the recommended safe GitHub Actions pattern: evaluate expressions in env, not inline in shell scripts.

Copilot AI changed the title [WIP] Fix template injection issue in label_new_issues-remove_label.yml Harden label_new_issues-remove_label against template injection Jul 21, 2026
Copilot AI requested a review from staticaland July 21, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

template-injection i label_new_issues-remove_label.yml

2 participants