File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,23 @@ jobs:
3636
3737 - name : Create release branch
3838 run : |
39+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
3940 TAG_NAME="v$PACKAGE_VERSION"
4041 RELEASE_BRANCH="release/${TAG_NAME}"
4142
42- # Create and push release branch
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"
53+ fi
54+
55+ # Create and push new release branch
4356 git checkout -b "$RELEASE_BRANCH"
4457 git push origin "$RELEASE_BRANCH"
4558
You can’t perform that action at this time.
0 commit comments