Summary
When gh pr create fails in post-code.sh, the error message is not visible in the workflow logs because stderr is redirected into the PR_URL variable via 2>&1.
Details
The current implementation captures both stdout and stderr into the PR_URL variable:
PR_URL="$(gh pr create \
--repo "${REPO_FULL_NAME}" \
--head "${BRANCH}" \
--base "${TARGET_BRANCH}" \
--title "${PR_TITLE}" \
--body "${PR_BODY}" \
2>&1)"
echo "PR created: ${PR_URL}"
When gh pr create fails, the error message (e.g. 403 Forbidden, 422 Validation Failed) is stored in PR_URL instead of being printed to the logs.
Suggested Fix
Use the if ! pattern already used in reconcile-repos.sh:
if ! PR_URL=$(gh pr create \
--repo "${REPO_FULL_NAME}" \
--head "${BRANCH}" \
--base "${TARGET_BRANCH}" \
--title "${PR_TITLE}" \
--body "${PR_BODY}"); then
echo "::error::Failed to create PR: see above for details"
exit 1
fi
Mirrored from fullsend-ai#2348
Summary
When
gh pr createfails inpost-code.sh, the error message is not visible in the workflow logs because stderr is redirected into thePR_URLvariable via2>&1.Details
The current implementation captures both stdout and stderr into the
PR_URLvariable:When
gh pr createfails, the error message (e.g. 403 Forbidden, 422 Validation Failed) is stored inPR_URLinstead of being printed to the logs.Suggested Fix
Use the
if !pattern already used inreconcile-repos.sh:Mirrored from fullsend-ai#2348