Skip to content

Commit 9d32f38

Browse files
committed
fix: use quoted heredocs for all external content in issue creation
1 parent 46d2d76 commit 9d32f38

1 file changed

Lines changed: 24 additions & 15 deletions

File tree

.github/workflows/openclaw-upgrade-check.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,13 @@ jobs:
469469
ISSUE_BODY_FILE=$(mktemp)
470470
COMMENT_BODY_FILE=$(mktemp)
471471
472-
# Build regression note safely
473-
REGRESSION_NOTE=""
472+
# Build regression note safely — use temp file to avoid shell expansion
473+
REGRESSION_FILE=$(mktemp)
474474
if [ "${{ needs.check-version.outputs.has_regressions }}" = "true" ]; then
475-
REGRESSION_NOTE="### Known Regressions
475+
echo '### Known Regressions' > "$REGRESSION_FILE"
476+
cat >> "$REGRESSION_FILE" <<'REGEOF'
476477
${{ needs.check-version.outputs.regression_list }}
477-
"
478+
REGEOF
478479
fi
479480
480481
# Check if issue already exists for this version
@@ -487,10 +488,12 @@ jobs:
487488
488489
**Failed stage:** ${STAGE}
489490
490-
\`\`\`
491-
${{ steps.failure.outputs.log }}
492-
\`\`\`
493491
ENDBODY
492+
echo '```' >> "$COMMENT_BODY_FILE"
493+
cat >> "$COMMENT_BODY_FILE" <<'LOGEOF'
494+
${{ steps.failure.outputs.log }}
495+
LOGEOF
496+
echo '```' >> "$COMMENT_BODY_FILE"
494497
gh issue comment "$EXISTING" --body-file "$COMMENT_BODY_FILE"
495498
# Trigger Copilot with user token if available
496499
if [ -n "$COPILOT_TRIGGER_TOKEN" ]; then
@@ -512,14 +515,20 @@ jobs:
512515
**Workflow run:** [${RUN_URL}](${RUN_URL})
513516
514517
### Test Output
515-
\`\`\`
516-
${{ steps.failure.outputs.log }}
517-
\`\`\`
518-
519-
${REGRESSION_NOTE}
520-
521-
### Release Notes
522518
ENDBODY
519+
# Append test log safely
520+
echo '```' >> "$ISSUE_BODY_FILE"
521+
cat >> "$ISSUE_BODY_FILE" <<'LOGEOF'
522+
${{ steps.failure.outputs.log }}
523+
LOGEOF
524+
echo '```' >> "$ISSUE_BODY_FILE"
525+
echo '' >> "$ISSUE_BODY_FILE"
526+
# Append regression notes if any
527+
if [ -s "$REGRESSION_FILE" ]; then
528+
cat "$REGRESSION_FILE" >> "$ISSUE_BODY_FILE"
529+
echo '' >> "$ISSUE_BODY_FILE"
530+
fi
531+
echo '### Release Notes' >> "$ISSUE_BODY_FILE"
523532
# Append release notes safely — no shell expansion
524533
cat >> "$ISSUE_BODY_FILE" <<'RELEASEEOF'
525534
${{ needs.check-version.outputs.release_notes }}
@@ -563,7 +572,7 @@ jobs:
563572
echo "⚠️ COPILOT_TRIGGER_TOKEN not set — Copilot must be triggered manually on issue #${ISSUE_NUMBER}"
564573
echo " Assign Copilot as assignee or post a @copilot comment on the issue."
565574
fi
566-
rm -f "$ISSUE_BODY_FILE" "$COMMENT_BODY_FILE"
575+
rm -f "$ISSUE_BODY_FILE" "$COMMENT_BODY_FILE" "$REGRESSION_FILE"
567576
env:
568577
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
569578
COPILOT_TRIGGER_TOKEN: ${{ secrets.COPILOT_TRIGGER_TOKEN }}

0 commit comments

Comments
 (0)