Skip to content

Commit

Permalink
Don't re-create version bump PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nlordell committed Jul 1, 2024
1 parent 7e1b368 commit 776ced9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/github-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ if [[ -z "$draft" ]] && [[ "$current" == "$latest" ]]; then
fi

newtag="$(npm version patch --no-git-tag-version)"
branch="version/$newtag"
if git ls-remote --heads origin | grep "refs/heads/$branch\$"; then
log "version bump PR already exists"
exit 0
fi
if [[ "$dryrun" == "n" ]]; then
log "updating repository to $newtag"
git checkout -b "version/$newtag"
git checkout -b "$branch"
git commit -am "$newtag"
git push -u origin "version/$newtag"
git push -u origin "$branch"
gh pr create --fill
fi
elif [[ "$current" != "$latest" ]]; then
Expand Down

0 comments on commit 776ced9

Please sign in to comment.