File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -40,16 +40,10 @@ jobs:
4040 TAG_NAME="v$PACKAGE_VERSION"
4141 RELEASE_BRANCH="release/${TAG_NAME}"
4242
43- # Check if branch exists and delete it if it does
44- if git show-ref --verify --quiet "refs/heads/$RELEASE_BRANCH"; then
45- echo "Branch $RELEASE_BRANCH already exists, deleting it..."
46- git branch -D "$RELEASE_BRANCH"
47- fi
48-
49- # Check if remote branch exists and delete it if it does
50- if git show-ref --verify --quiet "refs/remotes/origin/$RELEASE_BRANCH"; then
51- echo "Remote branch $RELEASE_BRANCH already exists, deleting it..."
52- git push origin --delete "$RELEASE_BRANCH"
43+ # Check if branch exists on GitHub
44+ if gh api --silent --fail-silently repos/:owner/:repo/branches/$RELEASE_BRANCH; then
45+ echo "Branch exists on GitHub, deleting..."
46+ gh api -X DELETE repos/:owner/:repo/git/refs/heads/$RELEASE_BRANCH
5347 fi
5448
5549 # Create and push new release branch
You can’t perform that action at this time.
0 commit comments