title="${GITHUB_PULL_REQUEST_TITLE:-Merge$head branch into $base branch}"
body="${GITHUB_PULL_REQUEST_BODY:-Created automatically by script \`${0##*/}\` in the [DevOps Bash tools](https://github.com/HariSekhon/DevOps-Bash-tools) repo}"
total_commits="$(gh api "/repos/$owner/$repo/compare/$base...$head" -q '.total_commits')"
total_commits="$(gh api "/repos/$owner/$repo/compare/$base...$head" -q '.total_commits')"
if["$total_commits" -gt 0];then
if["$total_commits" -gt 0];then
# check for existing PR between these branches before creating another
# check for existing PR between these branches before creating another
@ -124,8 +127,8 @@ if [ "$total_commits" -gt 0 ]; then
gh pr create -R "$owner/$repo"\
gh pr create -R "$owner/$repo"\
--base "$base"\
--base "$base"\
--head "$head"\
--head "$head"\
--title "Merge $head branch into $base branch"\
--title "$title"\
--body "Created automatically by script \`${0##*/}\` in the [DevOps Bash tools](https://github.com/HariSekhon/DevOps-Bash-tools) repo."\