From eb8cea14ad8976b3f1a1e67e3d203eb74d8f190c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:15:55 +0000 Subject: [PATCH 1/7] Initial plan From d04dc81e8329fb9f5e037795f3b7d1943f503443 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:26:09 +0000 Subject: [PATCH 2/7] fix: use remote HEAD SHA for push-to-pr-branch tracking links Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0ee73a6e-daeb-4d95-966a-043cf3270e83 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../setup/js/push_to_pull_request_branch.cjs | 38 +++++++++++++++---- .../js/push_to_pull_request_branch.test.cjs | 28 ++++++++++++++ 2 files changed, 59 insertions(+), 7 deletions(-) diff --git a/actions/setup/js/push_to_pull_request_branch.cjs b/actions/setup/js/push_to_pull_request_branch.cjs index 2337566f7c4..ca4a77f95c3 100644 --- a/actions/setup/js/push_to_pull_request_branch.cjs +++ b/actions/setup/js/push_to_pull_request_branch.cjs @@ -856,12 +856,33 @@ async function main(config = {}) { } } - // Get commit SHA and push URL - const commitShaRes = await exec.getExecOutput("git", ["rev-parse", "HEAD"]); - if (commitShaRes.exitCode !== 0) { - return { success: false, error: "Failed to get commit SHA" }; + // Resolve the actual remote branch HEAD SHA after push. + // This differs from local HEAD when pushSignedCommits replays commits via GraphQL. + let remoteCommitSha = ""; + try { + const remoteHeadResult = await exec.getExecOutput("git", ["ls-remote", "--exit-code", "--heads", "origin", branchName], { + env: { ...process.env, ...gitAuthEnv }, + ignoreReturnCode: true, + }); + if (remoteHeadResult.exitCode === 0) { + remoteCommitSha = (remoteHeadResult.stdout || "").trim().split(/\s+/)[0] || ""; + } else { + core.warning(`Failed to resolve remote HEAD SHA for ${branchName}: ${remoteHeadResult.stderr || `git ls-remote exited with code ${remoteHeadResult.exitCode}`}`); + } + } catch (resolveRemoteShaError) { + core.warning(`Failed to resolve remote HEAD SHA for ${branchName}: ${getErrorMessage(resolveRemoteShaError)}`); + } + + // Fallback to local HEAD for outputs/summary if remote lookup fails. + // Activation comment commit link is only updated when remote SHA is available. + let commitSha = remoteCommitSha; + if (!commitSha) { + const commitShaRes = await exec.getExecOutput("git", ["rev-parse", "HEAD"]); + if (commitShaRes.exitCode !== 0) { + return { success: false, error: "Failed to get commit SHA" }; + } + commitSha = commitShaRes.stdout.trim(); } - const commitSha = commitShaRes.stdout.trim(); // Get repository base URL and construct URLs // For cross-repo scenarios, use repoParts (the target repo) not context.repo (the workflow repo) @@ -875,8 +896,11 @@ async function main(config = {}) { // // NOTE: we pass 'github' (global octokit) instead of githubClient (repo-scoped octokit) because the issue is created // in the same repo as the activation, so the global client has the correct context for updating the comment. - if (hasChanges) { - await updateActivationCommentWithCommit(github, context, core, commitSha, commitUrl, { targetIssueNumber: pullNumber }); + if (hasChanges && remoteCommitSha) { + const remoteCommitUrl = `${repoUrl}/commit/${remoteCommitSha}`; + await updateActivationCommentWithCommit(github, context, core, remoteCommitSha, remoteCommitUrl, { targetIssueNumber: pullNumber }); + } else if (hasChanges) { + core.warning("Skipping activation comment commit link update because remote branch HEAD SHA could not be resolved"); } // Write summary to GitHub Actions summary diff --git a/actions/setup/js/push_to_pull_request_branch.test.cjs b/actions/setup/js/push_to_pull_request_branch.test.cjs index b7f94059c63..f0b7061fe94 100644 --- a/actions/setup/js/push_to_pull_request_branch.test.cjs +++ b/actions/setup/js/push_to_pull_request_branch.test.cjs @@ -637,6 +637,34 @@ index 0000000..abc1234 expect(result.commit_url).toContain("test-owner/test-repo/commit/"); }); + it("should use remote branch HEAD SHA for activation comment commit link", async () => { + const patchPath = createPatchFile(); + const updateActivationCommentModule = require("./update_activation_comment.cjs"); + const updateCommitSpy = vi.spyOn(updateActivationCommentModule, "updateActivationCommentWithCommit").mockResolvedValue(undefined); + const pushSignedCommitsModule = require("./push_signed_commits.cjs"); + const pushSignedSpy = vi.spyOn(pushSignedCommitsModule, "pushSignedCommits").mockResolvedValue(undefined); + + try { + mockExec.getExecOutput + .mockResolvedValueOnce({ exitCode: 0, stdout: "preflight-sha\trefs/heads/feature-branch\n", stderr: "" }) // preflight ls-remote + .mockResolvedValueOnce({ exitCode: 0, stdout: "local-head-before\n", stderr: "" }) // rev-parse HEAD before patch + .mockResolvedValueOnce({ exitCode: 0, stdout: "1\n", stderr: "" }) // rev-list --count + .mockResolvedValueOnce({ exitCode: 0, stdout: "remote-head-after\trefs/heads/feature-branch\n", stderr: "" }); // post-push ls-remote + + const module = await loadModule(); + const handler = await module.main({}); + const result = await handler({ patch_path: patchPath }, {}); + + expect(result.success).toBe(true); + expect(result.commit_sha).toBe("remote-head-after"); + expect(result.commit_url).toContain("/commit/remote-head-after"); + expect(updateCommitSpy).toHaveBeenCalledWith(mockGithub, mockContext, mockCore, "remote-head-after", "https://github.com/test-owner/test-repo/commit/remote-head-after", { targetIssueNumber: 123 }); + } finally { + pushSignedSpy.mockRestore(); + updateCommitSpy.mockRestore(); + } + }); + it("should detect deleted branch before fetch", async () => { const patchPath = createPatchFile(); From 9145fee2e1e5bdf04b30ff64760963f8a7092bf8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:28:36 +0000 Subject: [PATCH 3/7] test: clarify remote SHA warning context and regression setup Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0ee73a6e-daeb-4d95-966a-043cf3270e83 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/push_to_pull_request_branch.cjs | 12 +++++++++--- .../setup/js/push_to_pull_request_branch.test.cjs | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/actions/setup/js/push_to_pull_request_branch.cjs b/actions/setup/js/push_to_pull_request_branch.cjs index ca4a77f95c3..6ee5e30199f 100644 --- a/actions/setup/js/push_to_pull_request_branch.cjs +++ b/actions/setup/js/push_to_pull_request_branch.cjs @@ -867,10 +867,16 @@ async function main(config = {}) { if (remoteHeadResult.exitCode === 0) { remoteCommitSha = (remoteHeadResult.stdout || "").trim().split(/\s+/)[0] || ""; } else { - core.warning(`Failed to resolve remote HEAD SHA for ${branchName}: ${remoteHeadResult.stderr || `git ls-remote exited with code ${remoteHeadResult.exitCode}`}`); + core.warning( + `Failed to resolve remote HEAD SHA for ${branchName}: ${remoteHeadResult.stderr || `git ls-remote exited with code ${remoteHeadResult.exitCode}`}. ` + + "Commit push may still have succeeded, but the activation comment commit link will be skipped. Check branch existence, authentication, and network connectivity." + ); } } catch (resolveRemoteShaError) { - core.warning(`Failed to resolve remote HEAD SHA for ${branchName}: ${getErrorMessage(resolveRemoteShaError)}`); + core.warning( + `Failed to resolve remote HEAD SHA for ${branchName}: ${getErrorMessage(resolveRemoteShaError)}. ` + + "Commit push may still have succeeded, but the activation comment commit link will be skipped. Check branch existence, authentication, and network connectivity." + ); } // Fallback to local HEAD for outputs/summary if remote lookup fails. @@ -900,7 +906,7 @@ async function main(config = {}) { const remoteCommitUrl = `${repoUrl}/commit/${remoteCommitSha}`; await updateActivationCommentWithCommit(github, context, core, remoteCommitSha, remoteCommitUrl, { targetIssueNumber: pullNumber }); } else if (hasChanges) { - core.warning("Skipping activation comment commit link update because remote branch HEAD SHA could not be resolved"); + core.warning("Skipping activation comment commit link update because remote branch HEAD SHA could not be resolved. Commit push may still have succeeded."); } // Write summary to GitHub Actions summary diff --git a/actions/setup/js/push_to_pull_request_branch.test.cjs b/actions/setup/js/push_to_pull_request_branch.test.cjs index f0b7061fe94..ccaf50e8ed9 100644 --- a/actions/setup/js/push_to_pull_request_branch.test.cjs +++ b/actions/setup/js/push_to_pull_request_branch.test.cjs @@ -642,6 +642,7 @@ index 0000000..abc1234 const updateActivationCommentModule = require("./update_activation_comment.cjs"); const updateCommitSpy = vi.spyOn(updateActivationCommentModule, "updateActivationCommentWithCommit").mockResolvedValue(undefined); const pushSignedCommitsModule = require("./push_signed_commits.cjs"); + // Mock signed-commit replay to keep this test focused on post-push SHA resolution. const pushSignedSpy = vi.spyOn(pushSignedCommitsModule, "pushSignedCommits").mockResolvedValue(undefined); try { From 9f55663d3520db4d843487af143012b2adbb3ab8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:40:47 +0000 Subject: [PATCH 4/7] chore: harden remote HEAD SHA parsing for push comment links Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0ee73a6e-daeb-4d95-966a-043cf3270e83 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .../setup/js/push_to_pull_request_branch.cjs | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/actions/setup/js/push_to_pull_request_branch.cjs b/actions/setup/js/push_to_pull_request_branch.cjs index 6ee5e30199f..c9feea79f4e 100644 --- a/actions/setup/js/push_to_pull_request_branch.cjs +++ b/actions/setup/js/push_to_pull_request_branch.cjs @@ -865,17 +865,34 @@ async function main(config = {}) { ignoreReturnCode: true, }); if (remoteHeadResult.exitCode === 0) { - remoteCommitSha = (remoteHeadResult.stdout || "").trim().split(/\s+/)[0] || ""; + const remoteHeadLine = (remoteHeadResult.stdout || "").trim().split("\n")[0] || ""; + const remoteHeadParts = remoteHeadLine.split(/\s+/).filter(Boolean); + const remoteSha = remoteHeadParts[0] || ""; + const remoteRef = remoteHeadParts[1] || ""; + const expectedRef = `refs/heads/${branchName}`; + if (remoteSha && remoteRef === expectedRef) { + remoteCommitSha = remoteSha; + } else { + core.warning( + "Failed to parse remote HEAD SHA for " + + branchName + + ": unexpected ls-remote output '" + + remoteHeadLine + + "'. Expected format: ' " + + expectedRef + + "'. The activation comment commit link will be skipped. Commit push may still have succeeded." + ); + } } else { core.warning( `Failed to resolve remote HEAD SHA for ${branchName}: ${remoteHeadResult.stderr || `git ls-remote exited with code ${remoteHeadResult.exitCode}`}. ` + - "Commit push may still have succeeded, but the activation comment commit link will be skipped. Check branch existence, authentication, and network connectivity." + "Activation comment commit link will be skipped. Check branch existence, authentication, and network connectivity. Commit push may still have succeeded." ); } } catch (resolveRemoteShaError) { core.warning( `Failed to resolve remote HEAD SHA for ${branchName}: ${getErrorMessage(resolveRemoteShaError)}. ` + - "Commit push may still have succeeded, but the activation comment commit link will be skipped. Check branch existence, authentication, and network connectivity." + "The activation comment commit link will be skipped due to an unexpected ls-remote execution error. Commit push may still have succeeded." ); } From 43cdc30996a0ebf65e43c35800df1549f85688a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:53:40 +0000 Subject: [PATCH 5/7] fix: avoid post-push SHA lookup race in push-to-pr-branch Agent-Logs-Url: https://github.com/github/gh-aw/sessions/951e66f3-85d2-4731-99e3-582f7e7e5511 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/push_signed_commits.cjs | 6 +- .../setup/js/push_to_pull_request_branch.cjs | 59 ++++--------------- .../js/push_to_pull_request_branch.test.cjs | 8 +-- 3 files changed, 17 insertions(+), 56 deletions(-) diff --git a/actions/setup/js/push_signed_commits.cjs b/actions/setup/js/push_signed_commits.cjs index 2546e0e9bd3..9dc0ee86844 100644 --- a/actions/setup/js/push_signed_commits.cjs +++ b/actions/setup/js/push_signed_commits.cjs @@ -128,7 +128,7 @@ async function readBlobAsBase64(blobHash, cwd) { * @param {string} opts.baseRef - Git ref of the remote head before commits were applied (used for rev-list) * @param {string} opts.cwd - Working directory of the local git checkout * @param {object} [opts.gitAuthEnv] - Environment variables for git push fallback auth - * @returns {Promise} + * @returns {Promise} SHA of the commit that landed on the target branch */ async function pushSignedCommits({ githubClient, owner, repo, branch, baseRef, cwd, gitAuthEnv }) { // Collect the commits introduced (oldest-first) using topological order to ensure @@ -141,7 +141,7 @@ async function pushSignedCommits({ githubClient, owner, repo, branch, baseRef, c if (shas.length === 0) { core.info("pushSignedCommits: no new commits to push via GraphQL"); - return; + return undefined; } core.info(`pushSignedCommits: replaying ${shas.length} commit(s) via GraphQL createCommitOnBranch (branch: ${branch}, repo: ${owner}/${repo})`); @@ -362,12 +362,14 @@ async function pushSignedCommits({ githubClient, owner, repo, branch, baseRef, c core.info(`pushSignedCommits: signed commit created: ${lastOid}`); } core.info(`pushSignedCommits: all ${shas.length} commit(s) pushed as signed commits`); + return lastOid || shas[shas.length - 1]; } catch (graphqlError) { core.warning(`pushSignedCommits: GraphQL signed push failed, falling back to git push: ${graphqlError instanceof Error ? graphqlError.message : String(graphqlError)}`); await exec.exec("git", ["push", "origin", branch], { cwd, env: { ...process.env, ...(gitAuthEnv || {}) }, }); + return shas[shas.length - 1]; } } diff --git a/actions/setup/js/push_to_pull_request_branch.cjs b/actions/setup/js/push_to_pull_request_branch.cjs index c9feea79f4e..6909bcc9dab 100644 --- a/actions/setup/js/push_to_pull_request_branch.cjs +++ b/actions/setup/js/push_to_pull_request_branch.cjs @@ -555,6 +555,7 @@ async function main(config = {}) { // token on multi-commit branches where workflow files may have been modified). let newCommitCount = 0; let remoteHeadBeforePatch = ""; + let pushedCommitSha = ""; if (hasChanges) { // Capture HEAD before applying changes to compute new-commit count later try { @@ -736,7 +737,7 @@ async function main(config = {}) { // Push the applied commits to the branch using signed GraphQL commits (outside patch try/catch so push failures are not misattributed) try { - await pushSignedCommits({ + const pushedSha = await pushSignedCommits({ githubClient, owner: repoParts.owner, repo: repoParts.repo, @@ -745,6 +746,9 @@ async function main(config = {}) { cwd: process.cwd(), gitAuthEnv, }); + if (typeof pushedSha === "string" && pushedSha.length > 0) { + pushedCommitSha = pushedSha; + } core.info(`Changes committed and pushed to branch: ${branchName}`); } catch (pushError) { const pushErrorMessage = getErrorMessage(pushError); @@ -856,49 +860,9 @@ async function main(config = {}) { } } - // Resolve the actual remote branch HEAD SHA after push. - // This differs from local HEAD when pushSignedCommits replays commits via GraphQL. - let remoteCommitSha = ""; - try { - const remoteHeadResult = await exec.getExecOutput("git", ["ls-remote", "--exit-code", "--heads", "origin", branchName], { - env: { ...process.env, ...gitAuthEnv }, - ignoreReturnCode: true, - }); - if (remoteHeadResult.exitCode === 0) { - const remoteHeadLine = (remoteHeadResult.stdout || "").trim().split("\n")[0] || ""; - const remoteHeadParts = remoteHeadLine.split(/\s+/).filter(Boolean); - const remoteSha = remoteHeadParts[0] || ""; - const remoteRef = remoteHeadParts[1] || ""; - const expectedRef = `refs/heads/${branchName}`; - if (remoteSha && remoteRef === expectedRef) { - remoteCommitSha = remoteSha; - } else { - core.warning( - "Failed to parse remote HEAD SHA for " + - branchName + - ": unexpected ls-remote output '" + - remoteHeadLine + - "'. Expected format: ' " + - expectedRef + - "'. The activation comment commit link will be skipped. Commit push may still have succeeded." - ); - } - } else { - core.warning( - `Failed to resolve remote HEAD SHA for ${branchName}: ${remoteHeadResult.stderr || `git ls-remote exited with code ${remoteHeadResult.exitCode}`}. ` + - "Activation comment commit link will be skipped. Check branch existence, authentication, and network connectivity. Commit push may still have succeeded." - ); - } - } catch (resolveRemoteShaError) { - core.warning( - `Failed to resolve remote HEAD SHA for ${branchName}: ${getErrorMessage(resolveRemoteShaError)}. ` + - "The activation comment commit link will be skipped due to an unexpected ls-remote execution error. Commit push may still have succeeded." - ); - } - - // Fallback to local HEAD for outputs/summary if remote lookup fails. - // Activation comment commit link is only updated when remote SHA is available. - let commitSha = remoteCommitSha; + // The signed-push helper returns the commit SHA that landed on the branch. + // Fall back to local HEAD only if the helper did not return one. + let commitSha = pushedCommitSha; if (!commitSha) { const commitShaRes = await exec.getExecOutput("git", ["rev-parse", "HEAD"]); if (commitShaRes.exitCode !== 0) { @@ -919,11 +883,8 @@ async function main(config = {}) { // // NOTE: we pass 'github' (global octokit) instead of githubClient (repo-scoped octokit) because the issue is created // in the same repo as the activation, so the global client has the correct context for updating the comment. - if (hasChanges && remoteCommitSha) { - const remoteCommitUrl = `${repoUrl}/commit/${remoteCommitSha}`; - await updateActivationCommentWithCommit(github, context, core, remoteCommitSha, remoteCommitUrl, { targetIssueNumber: pullNumber }); - } else if (hasChanges) { - core.warning("Skipping activation comment commit link update because remote branch HEAD SHA could not be resolved. Commit push may still have succeeded."); + if (hasChanges) { + await updateActivationCommentWithCommit(github, context, core, commitSha, commitUrl, { targetIssueNumber: pullNumber }); } // Write summary to GitHub Actions summary diff --git a/actions/setup/js/push_to_pull_request_branch.test.cjs b/actions/setup/js/push_to_pull_request_branch.test.cjs index ccaf50e8ed9..0a2bc25112b 100644 --- a/actions/setup/js/push_to_pull_request_branch.test.cjs +++ b/actions/setup/js/push_to_pull_request_branch.test.cjs @@ -637,20 +637,18 @@ index 0000000..abc1234 expect(result.commit_url).toContain("test-owner/test-repo/commit/"); }); - it("should use remote branch HEAD SHA for activation comment commit link", async () => { + it("should use pushed commit SHA returned by pushSignedCommits for activation comment commit link", async () => { const patchPath = createPatchFile(); const updateActivationCommentModule = require("./update_activation_comment.cjs"); const updateCommitSpy = vi.spyOn(updateActivationCommentModule, "updateActivationCommentWithCommit").mockResolvedValue(undefined); const pushSignedCommitsModule = require("./push_signed_commits.cjs"); - // Mock signed-commit replay to keep this test focused on post-push SHA resolution. - const pushSignedSpy = vi.spyOn(pushSignedCommitsModule, "pushSignedCommits").mockResolvedValue(undefined); + const pushSignedSpy = vi.spyOn(pushSignedCommitsModule, "pushSignedCommits").mockResolvedValue("remote-head-after"); try { mockExec.getExecOutput .mockResolvedValueOnce({ exitCode: 0, stdout: "preflight-sha\trefs/heads/feature-branch\n", stderr: "" }) // preflight ls-remote .mockResolvedValueOnce({ exitCode: 0, stdout: "local-head-before\n", stderr: "" }) // rev-parse HEAD before patch - .mockResolvedValueOnce({ exitCode: 0, stdout: "1\n", stderr: "" }) // rev-list --count - .mockResolvedValueOnce({ exitCode: 0, stdout: "remote-head-after\trefs/heads/feature-branch\n", stderr: "" }); // post-push ls-remote + .mockResolvedValueOnce({ exitCode: 0, stdout: "1\n", stderr: "" }); // rev-list --count const module = await loadModule(); const handler = await module.main({}); From 0fe183cd9f457de43096fbe8c2645aff26dd49cf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:55:47 +0000 Subject: [PATCH 6/7] refactor: use returned pushed SHA consistently in signed push flow Agent-Logs-Url: https://github.com/github/gh-aw/sessions/951e66f3-85d2-4731-99e3-582f7e7e5511 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/push_signed_commits.cjs | 2 +- actions/setup/js/push_to_pull_request_branch.cjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/setup/js/push_signed_commits.cjs b/actions/setup/js/push_signed_commits.cjs index 9dc0ee86844..c86d35786db 100644 --- a/actions/setup/js/push_signed_commits.cjs +++ b/actions/setup/js/push_signed_commits.cjs @@ -362,7 +362,7 @@ async function pushSignedCommits({ githubClient, owner, repo, branch, baseRef, c core.info(`pushSignedCommits: signed commit created: ${lastOid}`); } core.info(`pushSignedCommits: all ${shas.length} commit(s) pushed as signed commits`); - return lastOid || shas[shas.length - 1]; + return lastOid ?? shas[shas.length - 1]; } catch (graphqlError) { core.warning(`pushSignedCommits: GraphQL signed push failed, falling back to git push: ${graphqlError instanceof Error ? graphqlError.message : String(graphqlError)}`); await exec.exec("git", ["push", "origin", branch], { diff --git a/actions/setup/js/push_to_pull_request_branch.cjs b/actions/setup/js/push_to_pull_request_branch.cjs index 6909bcc9dab..d81246153e2 100644 --- a/actions/setup/js/push_to_pull_request_branch.cjs +++ b/actions/setup/js/push_to_pull_request_branch.cjs @@ -746,7 +746,7 @@ async function main(config = {}) { cwd: process.cwd(), gitAuthEnv, }); - if (typeof pushedSha === "string" && pushedSha.length > 0) { + if (pushedSha) { pushedCommitSha = pushedSha; } core.info(`Changes committed and pushed to branch: ${branchName}`); From b91965d13585e4da3185f4ad4f37cc4bbe815783 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Apr 2026 04:21:05 +0000 Subject: [PATCH 7/7] chore: add pushed SHA logging in push flow Agent-Logs-Url: https://github.com/github/gh-aw/sessions/674f9b35-3168-4e8d-9fea-69232363ddee Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/push_signed_commits.cjs | 4 +++- actions/setup/js/push_to_pull_request_branch.cjs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/actions/setup/js/push_signed_commits.cjs b/actions/setup/js/push_signed_commits.cjs index c86d35786db..5b28dcfda41 100644 --- a/actions/setup/js/push_signed_commits.cjs +++ b/actions/setup/js/push_signed_commits.cjs @@ -369,7 +369,9 @@ async function pushSignedCommits({ githubClient, owner, repo, branch, baseRef, c cwd, env: { ...process.env, ...(gitAuthEnv || {}) }, }); - return shas[shas.length - 1]; + const fallbackSha = shas[shas.length - 1]; + core.info(`pushSignedCommits: git push fallback completed, using pushed SHA ${fallbackSha}`); + return fallbackSha; } } diff --git a/actions/setup/js/push_to_pull_request_branch.cjs b/actions/setup/js/push_to_pull_request_branch.cjs index d81246153e2..ad3c52dcf39 100644 --- a/actions/setup/js/push_to_pull_request_branch.cjs +++ b/actions/setup/js/push_to_pull_request_branch.cjs @@ -748,6 +748,7 @@ async function main(config = {}) { }); if (pushedSha) { pushedCommitSha = pushedSha; + core.info(`pushSignedCommits returned pushed SHA: ${pushedSha}`); } core.info(`Changes committed and pushed to branch: ${branchName}`); } catch (pushError) {