Skip to content

Commit

Permalink
fix: 🐛 issue with gh pr edit
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Augustin <dev@andreas-augustin.org>
  • Loading branch information
AndreasAugustin committed Jun 16, 2024
1 parent d1b4d54 commit 676ff71
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 676ff71

Please sign in to comment.