diff --git a/src/sync_template.sh b/src/sync_template.sh index 9d2bbf0..0e180f3 100755 --- a/src/sync_template.sh +++ b/src/sync_template.sh @@ -331,19 +331,21 @@ function create_pr() { # Arguments: # title # body -# branch +# upstream_branch # labels # reviewers +# pr_branch ################################### function create_or_edit_pr() { info "create pr or edit the pr" local title=$1 local body=$2 - local branch=$3 + local upstream_branch=$3 local labels=$4 local reviewers=$5 + local pr_branch=$6 - create_pr "${title}" "${body}" "${branch}" "${labels}" "${reviewers}" || gh pr edit \ + create_pr "${title}" "${body}" "${upstream_branch}" "${labels}" "${reviewers}" || gh pr edit "${pr_branch}" \ --title "${title}" \ --body "${body}" \ --add-label "${labels}" \ @@ -489,7 +491,7 @@ function arr_prepare_pr_create_pr() { cmd_from_yml "prepr" if [ "$IS_FORCE_PUSH_PR" == true ] ; then - create_or_edit_pr "${PR_TITLE}" "${PR_BODY}" "${UPSTREAM_BRANCH}" "${PR_LABELS}" "${PR_REVIEWERS}" + create_or_edit_pr "${PR_TITLE}" "${PR_BODY}" "${UPSTREAM_BRANCH}" "${PR_LABELS}" "${PR_REVIEWERS}" "${PR_BRANCH}" else create_pr "${PR_TITLE}" "${PR_BODY}" "${UPSTREAM_BRANCH}" "${PR_LABELS}" "${PR_REVIEWERS}" fi