Skip to content

Commit

Permalink
need better comments for Issue PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ivvist committed Jul 30, 2023
1 parent 35f00f0 commit c95b5f4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/domergepr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ jqbase64 () {
echo "Pull request author: $auth_login"

# Get pull request body
needbody=0
body=$(gh pr view $pr_number --json body -R ${repo}| jq -r '.body')
prnum="(#$pr_number)"
body=$body$prnum
repl="Resolves #"
newrepl="Resolves issue #"
body=${body/$repl/$newrepl}
if [[ "$body" == *"$repl"* ]]; then
prnum="(#$pr_number)"
body=$body$prnum
newrepl="Resolves issue #"
body=${body/$repl/$newrepl}
needbody=1
fi

userfound=0
header="Accept: application/vnd.github+json"
Expand Down Expand Up @@ -46,7 +50,11 @@ jqbase64 () {
fi

# Merge pull request with squash
gh pr merge https://github.com/${repo}/pull/$pr_number -b " " -t "$body" --squash --delete-branch
if [[ $needbody -eq 0 ]]; then
gh pr merge https://github.com/${repo}/pull/$pr_number --squash --delete-branch
else
gh pr merge https://github.com/${repo}/pull/$pr_number -b " " -t "$body" --squash --delete-branch
fi

# Delete remote branch
# git push origin :$br_name

0 comments on commit c95b5f4

Please sign in to comment.