fix(ci): route dispatcher pr_number through env in remaining run steps (MAPPS-306) #371
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-306-pr-number-injection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
MAPPS-307 routed PR_TITLE, PR_BRANCH, HEAD_SHA, and EXTRA_INSTRUCTIONS through
env:in the Build failure context, Run Claude Code, and Commit and push steps, but tworun:scripts still interpolated the dispatcher-supplied${{ inputs.pr_number }}directly into their bodies: Get PR metadata (curl URL and theecho "PR #..."line) and Post PR comment (the comments API URL). pr_number is untrusted dispatcher input, so a crafted value could be expanded by the workflow templater into the script and parsed as shell.Pass pr_number through
env: PR_NUMBERin both steps and reference it as quoted "$PR_NUMBER", matching the safer pattern already used elsewhere. github.server_url and github.repository stay as direct expressions since they are platform-trusted contexts, not shell-parsed untrusted data.#MAPPS-306
MAPPS-307 routed PR_TITLE, PR_BRANCH, HEAD_SHA, and EXTRA_INSTRUCTIONS through `env:` in the Build failure context, Run Claude Code, and Commit and push steps, but two `run:` scripts still interpolated the dispatcher-supplied `${{ inputs.pr_number }}` directly into their bodies: Get PR metadata (curl URL and the `echo "PR #..."` line) and Post PR comment (the comments API URL). pr_number is untrusted dispatcher input, so a crafted value could be expanded by the workflow templater into the script and parsed as shell. Pass pr_number through `env: PR_NUMBER` in both steps and reference it as quoted "$PR_NUMBER", matching the safer pattern already used elsewhere. github.server_url and github.repository stay as direct expressions since they are platform-trusted contexts, not shell-parsed untrusted data. #MAPPS-306