Skip to content

Commit 3d2633a

Browse files
committed
update workflow for release branch
1 parent c5949b2 commit 3d2633a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)