Skip to content

fix(ci): prevent shell expansion in promotion PR body#167

Merged
iamfj merged 1 commit intonextfrom
fix/promotion-pr-body-shell-interpolation
Apr 23, 2026
Merged

fix(ci): prevent shell expansion in promotion PR body#167
iamfj merged 1 commit intonextfrom
fix/promotion-pr-body-shell-interpolation

Conversation

@iamfj
Copy link
Copy Markdown
Member

@iamfj iamfj commented Apr 23, 2026

Summary

  • fix promotion workflow PR update/create step to avoid shell command substitution in markdown content
  • pass metadata through environment variables and use --body-file instead of inline --body

Root cause

steps.meta.outputs.body includes markdown backticks (for next, main, version). Injecting that output directly into the run script as:

--body "${{ steps.meta.outputs.body }}"

causes the shell to evaluate backticks during command execution. That strips content (or executes command substitution), producing empty placeholders in the PR description.

Fix

  • add env vars:
    • PROMOTION_PR_TITLE: ${{ steps.meta.outputs.title }}
    • PROMOTION_PR_BODY: ${{ steps.meta.outputs.body }}
  • write body to temp file with printf '%s\n' "$PROMOTION_PR_BODY"
  • call:
    • gh pr edit ... --title "$PROMOTION_PR_TITLE" --body-file "$body_file"
    • gh pr create ... --title "$PROMOTION_PR_TITLE" --body-file "$body_file"

Validation

  • reproduces prior symptom pattern exactly (missing next / main / version)
  • removes command-substitution path entirely by not embedding raw markdown output in the run script command line

@iamfj iamfj force-pushed the fix/promotion-pr-body-shell-interpolation branch from 02fb64c to c297307 Compare April 23, 2026 08:08
@iamfj iamfj merged commit 2a066a6 into next Apr 23, 2026
10 checks passed
@iamfj iamfj deleted the fix/promotion-pr-body-shell-interpolation branch April 23, 2026 08:10
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.

1 participant