From 676ff71b5b12ea9b30555da28e8aade2469cc08f Mon Sep 17 00:00:00 2001 From: Andy Augustin Date: Sun, 16 Jun 2024 13:31:23 +0200 Subject: [PATCH] fix: :bug: issue with gh pr edit Signed-off-by: Andy Augustin --- src/sync_template.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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