Improve fallback issue instructions when PR creation fails#18536
Merged
Conversation
Add complete git/gh commands (branch creation, patch apply, push, PR creation) to fallback issues created when push or PR creation fails. Fixes issue where instructions were incomplete. Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update instructions for failed pull request creation
Improve fallback issue instructions when PR creation fails
Feb 26, 2026
dsyme
approved these changes
Feb 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the fallback instructions shown to users when automated PR creation fails, providing complete step-by-step workflows instead of basic patch application commands.
Changes:
- Enhanced push-failed fallback with complete workflow: branch creation, patch application, push, and PR creation commands
- Updated PR-creation-failed fallback to include ready-to-run
gh pr createcommand with pre-filled parameters - Standardized markdown formatting using
> [!NOTE]blocks for consistency
Comments suppressed due to low confidence (1)
actions/setup/js/create_pull_request.cjs:954
- The title variable is directly interpolated into the shell command without proper escaping. If the title contains double quotes, backticks, dollar signs, or other shell special characters, it could break the command or potentially lead to unintended command execution. Consider using single quotes instead of double quotes around the title, or escape shell special characters in the title before interpolation. For example:
gh pr create --title '${title}' ...or properly escape the title value for shell usage.
gh pr create --title "${title}" --base ${baseBranch} --head ${branchName} --repo ${repoParts.owner}/${repoParts.repo}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fallback issues created on push/PR-creation failures only showed how to download and apply the patch — leaving users to figure out branch creation and PR submission themselves.
Changes
Push-failed fallback: Replaced the bare
git amsnippet with a complete workflow —git checkout -b,git am --3way,git push, andgh pr create— with actual values (branch name, base branch, run ID, patch path, repo) interpolated from context.PR-creation-failed fallback: Replaced the vague "You can manually create a pull request from the branch if needed" prose with a ready-to-run
gh pr createcommand (title, base, head, and repo pre-filled). Reformatted the note block to use> [!NOTE]consistent with the push-failed case.Example of new push-failed instructions:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.