You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[plan] Fix commit ordering (--topo-order) and add merge commit handling in push_signed_commits.cjs #26255
Fix push_signed_commits.cjs to use topological ordering when listing commits, and add graceful handling for merge commits.
Context
Reported in issue #26156. Two related ordering/topology bugs affect multi-commit pushes.
Bugs to Fix
1. git rev-list uses commit-date order by default (line 40)
// WRONG: may return commits in wrong order if dates are out of sync (e.g. after rebase --committer-date-is-author-date)const{stdout: revListOut}=awaitexec.getExecOutput("git",["rev-list","--reverse",`${baseRef}..HEAD`],{ cwd });
Fix: Add --topo-order to ensure commits are always listed in graph/topology order:
git rev-list will list commits from both parents of a merge commit. When the code tries to call createCommitOnBranch for a merge commit, it will produce incorrect results since:
The diff ${sha}^ against a merge commit is ambiguous (uses first parent)
createCommitOnBranch does not support multiple parents
Fix: Detect merge commits (those with more than one parent) and skip the GraphQL path for the entire series, falling back to git push instead. Add a pre-flight check before the loop:
// Check if any commit in the series is a merge commitfor(constshaofshas){const{ stdout }=awaitexec.getExecOutput("git",["cat-file","-p",sha],{ cwd });constparentCount=(stdout.match(/^parent/gm)||[]).length;if(parentCount>1){core.warning(`pushSignedCommits: merge commit ${sha} detected, falling back to git push`);// fall through to git push fallbackthrownewError("merge commit detected");}}
Files to Modify
actions/setup/js/push_signed_commits.cjs
Acceptance Criteria
--topo-order is added to git rev-list call
Merge commits cause an early fallback to git push with a clear warning message
Activity
github-actions commentedon Apr 14, 2026
🍪 Issue Monster has assigned this to Copilot!
I've identified this issue as a good candidate for automated resolution and assigned it to the Copilot coding agent.
The Copilot coding agent will analyze the issue and create a pull request with the fix.
Om nom nom! 🍪