From deea1e7692a90a6d6e463a5a3b8c8d758c1027ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:03:14 +0000 Subject: [PATCH 1/3] Initial plan From 9dc8954a7deac67886720b856b62d9cbc65969af Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:10:57 +0000 Subject: [PATCH 2/3] Improve fallback issue instructions for pull request creation failures 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> --- actions/setup/js/create_pull_request.cjs | 27 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/actions/setup/js/create_pull_request.cjs b/actions/setup/js/create_pull_request.cjs index 2dd78d6007..78411db3e5 100644 --- a/actions/setup/js/create_pull_request.cjs +++ b/actions/setup/js/create_pull_request.cjs @@ -673,16 +673,23 @@ async function main(config = {}) { > > The patch file is available in the \`agent-artifacts\` artifact in the workflow run linked above. -To apply the patch locally: +To create a pull request with the changes: \`\`\`sh -# Download the artifact from the workflow run ${runUrl} -# (Use GitHub MCP tools if gh CLI is not available) +# Download the artifact from the workflow run gh run download ${runId} -n agent-artifacts -D /tmp/agent-artifacts-${runId} -# The patch file will be at agent-artifacts/tmp/gh-aw/${patchFileName} after download +# Create a new branch +git checkout -b ${branchName} + # Apply the patch (--3way handles cross-repo patches where files may already exist) git am --3way /tmp/agent-artifacts-${runId}/${patchFileName} + +# Push the branch to origin +git push origin ${branchName} + +# Create the pull request +gh pr create --title "${title}" --base ${baseBranch} --head ${branchName} --repo ${repoParts.owner}/${repoParts.repo} \`\`\` ${patchPreview}`; @@ -936,11 +943,17 @@ ${patchPreview}`; --- -**Note:** This was originally intended as a pull request, but PR creation failed. The changes have been pushed to the branch [\`${branchName}\`](${branchUrl}). +> [!NOTE] +> This was originally intended as a pull request, but PR creation failed. The changes have been pushed to the branch [\`${branchName}\`](${branchUrl}). +> +> **Original error:** ${errorMessage} -**Original error:** ${errorMessage} +To create the pull request manually: -You can manually create a pull request from the branch if needed.${patchPreview}`; +\`\`\`sh +gh pr create --title "${title}" --base ${baseBranch} --head ${branchName} --repo ${repoParts.owner}/${repoParts.repo} +\`\`\` +${patchPreview}`; try { const { data: issue } = await github.rest.issues.create({ From 4b196d543e847b8805462c814ee9b64491211d48 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 26 Feb 2026 21:12:25 +0000 Subject: [PATCH 3/3] Update actions/setup/js/create_pull_request.cjs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- actions/setup/js/create_pull_request.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/setup/js/create_pull_request.cjs b/actions/setup/js/create_pull_request.cjs index 78411db3e5..d8ca55a392 100644 --- a/actions/setup/js/create_pull_request.cjs +++ b/actions/setup/js/create_pull_request.cjs @@ -689,7 +689,7 @@ git am --3way /tmp/agent-artifacts-${runId}/${patchFileName} git push origin ${branchName} # Create the pull request -gh pr create --title "${title}" --base ${baseBranch} --head ${branchName} --repo ${repoParts.owner}/${repoParts.repo} +gh pr create --title '${title}' --base ${baseBranch} --head ${branchName} --repo ${repoParts.owner}/${repoParts.repo} \`\`\` ${patchPreview}`;