mirror of
https://code.forgejo.org/actions/cascading-pr.git
synced 2025-06-28 04:43:44 +00:00
close-merge is close and applies to destination-ref as well
* workflows that have close-merge need to change to close * the behavior for when origin-pr is set does not change * the behavior for when origin-ref is set is to honor close instead of always closing the PR
This commit is contained in:
parent
5007c13756
commit
09dc15f425
5 changed files with 14 additions and 10 deletions
|
@ -385,7 +385,7 @@ function finalize_options() {
|
|||
options[destination_is_fork]=false
|
||||
fi
|
||||
|
||||
: ${options[close_merge]:=false}
|
||||
: ${options[close]:=false}
|
||||
}
|
||||
|
||||
function run() {
|
||||
|
@ -414,7 +414,10 @@ function run_origin_ref() {
|
|||
log_info "cascade PR status failed"
|
||||
status=1
|
||||
fi
|
||||
close_pr
|
||||
if "${options[close]}" ; then
|
||||
log_info "close the cascade PR and remove the branch"
|
||||
close_pr
|
||||
fi
|
||||
return $status
|
||||
fi
|
||||
}
|
||||
|
@ -436,7 +439,7 @@ function run_origin_pr() {
|
|||
;;
|
||||
closed)
|
||||
if "$(pr_merged origin)"; then
|
||||
if "${options[close_merge]}" ; then
|
||||
if "${options[close]}" ; then
|
||||
log_info "PR is merged, close the cascade PR and remove the branch"
|
||||
close_pr
|
||||
else
|
||||
|
@ -528,9 +531,9 @@ function main() {
|
|||
options[prefix]=$1
|
||||
shift
|
||||
;;
|
||||
--close-merge)
|
||||
--close)
|
||||
shift
|
||||
options[close_merge]=$1
|
||||
options[close]=$1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue