Skip to content

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

Description

@dwisiswant0

Add an input to pr/merge that merges the pull request only while its head is a given commit, so a caller can merge exactly the commit its checks ran on.

pr/merge merges whatever the pull request's head is when it runs (merge.sh). A workflow that merges after checks pass, such as Dependabot auto-merge, can therefore merge a commit pushed after the checks ran, which the checks never saw.

gh pr merge already supports this with --match-head-commit. The new input would pass that flag through, and callers that leave it empty keep today's behavior.

Needed by projectdiscovery/workflows#3.

Metadata

Metadata

Assignees

Labels

Type: Enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions