mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-21 14:08:19 +02:00
feat: auto-detect the value of the no-squash option
The auto-no-squash option is added to: * backport all the commits when the pull/merge request has been merged * backport the squashed commit otherwise It is equivalent to dynamically adjust the value of the no-squash option, depending on the context. The no-squash option is kept for backward compatibility for a single use case: backporting the merged commit instead of backporting the commits of the pull/merge request request. Detecting if a pull/merge request was squashed or not depends on the underlying forge: * Forgejo / GitHub: use the API to count the number of parents * GitLab: if the squash_commit_sha is set, the merge request was squashed If the pull/merge request is open, always backport all the commits it contains. Fixes: https://github.com/kiegroup/git-backporting/issues/113 Co-authored-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
This commit is contained in:
parent
fc5dba6703
commit
f591021c06
23 changed files with 324 additions and 54 deletions
10
action.yml
10
action.yml
|
@ -85,10 +85,14 @@ inputs:
|
|||
default: "false"
|
||||
no-squash:
|
||||
description: >
|
||||
If set to true the tool will backport all commits as part of the pull request
|
||||
instead of the suqashed one
|
||||
Backport all commits found in the pull request.
|
||||
The default behavior is to only backport the first commit that was merged in the base branch.
|
||||
required: false
|
||||
auto-no-squash:
|
||||
description: >
|
||||
If the pull request was merged or is open, backport all commits.
|
||||
If the pull request commits were squashed, backport the squashed commit.
|
||||
required: false
|
||||
default: "false"
|
||||
strategy:
|
||||
description: Cherry-pick merge strategy
|
||||
required: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue