Skip to content

Commit ffca56e

Browse files
Refactor version bump workflow in GitHub Actions
Modified version bump process to create a new branch for version bumps and update the main branch accordingly. Signed-off-by: Karan Mohindroo <96403086+NullPointerDepressiveDisorder@users.noreply.github.com>
1 parent df9d293 commit ffca56e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/_get-version.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ jobs:
9393
fi
9494
9595
git fetch origin "$BRANCH_NAME"
96-
git checkout "$BRANCH_NAME"
97-
git reset --hard "origin/$BRANCH_NAME"
96+
git checkout -b "version-bump-$VERSION"
9897
9998
NOTES="${{ inputs.notes }}"
10099
./bump-version.sh "$VERSION" "$NOTES"
@@ -103,6 +102,10 @@ jobs:
103102
git fetch origin "$BRANCH_NAME"
104103
git rebase "origin/$BRANCH_NAME"
105104
105+
# Update main branch to point to new commit
106+
git checkout "$BRANCH_NAME"
107+
git reset --hard "version-bump-$VERSION"
108+
106109
# Re-create the tag to point to HEAD after rebase
107110
git tag -f -a "v$VERSION" -m "$(git tag -l --format='%(contents)' "v$VERSION" 2>/dev/null || echo "Release v$VERSION")"
108111

0 commit comments

Comments
 (0)