Skip to content

feat(merge): add match-head-commit input - #123

Merged
dwisiswant0 merged 1 commit into
masterfrom
dwisiswant0/feat/merge/add-match-head-commit-input
Nov 20, 2026
Merged

dwisiswant0 merged 1 commit into
masterfrom
dwisiswant0/feat/merge/add-match-head-commit-input

Conversation

@dwisiswant0

Copy link
Copy Markdown
Member

pr/merge merged whatever the pull request head was when it ran, so a
workflow that merges after its checks pass could merge a commit those
checks never saw.

The new input passes a SHA to gh's --match-head-commit. GitHub checks
it on a direct merge, but an auto-merge request doesn't store it, so a
caller that must merge only that commit sets auto to false. The value
expands as one argument, so it cannot add other gh flags. A head
mismatch is not a transient error and fails without a retry. Leaving
the input empty keeps the current behavior.

Closes: #122

pr/merge merged whatever the pull request head was when it ran, so a
workflow that merges after its checks pass could merge a commit those
checks never saw.

The new input passes a SHA to gh's --match-head-commit. GitHub checks
it on a direct merge, but an auto-merge request doesn't store it, so a
caller that must merge only that commit sets auto to false. The value
expands as one argument, so it cannot add other gh flags. A head
mismatch is not a transient error and fails without a retry. Leaving
the input empty keeps the current behavior.

Closes: #122
Signed-off-by: Dwi Siswanto <[email protected]>
@dwisiswant0
dwisiswant0 merged commit 66d42b0 into master Nov 20, 2026
@dwisiswant0
dwisiswant0 deleted the dwisiswant0/feat/merge/add-match-head-commit-input branch November 20, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pr/merge: support merging only when the PR head is a given commit

1 participant