Skip to content

Commit 909a53f

Browse files
committed
Fixed logic in auto bump workflow
1 parent 7bfa2a4 commit 909a53f

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.github/workflows/bumpversion.yaml

+16-6
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,22 @@ jobs:
4343
if: ${{ github.event_name != 'workflow_dispatch' }}
4444
shell: bash
4545
run: |
46-
if [[ $RELEASE_KIND != "no-release" ]]; then
47-
bump-my-version bump -v "$RELEASE_KIND"
48-
git push
49-
git push --tags
50-
echo "PACKAGE=true" >> $GITHUB_ENV
51-
fi
46+
PR_NUMBER=$(gh pr view --json number -q .number || echo "")
47+
REVISION=$(git describe --tags --long | awk -F- '{print $2}')
48+
export PR_NUMBER REVISION
49+
case "$RELEASE_KIND" in
50+
major|minor|patch)
51+
bump-my-version bump "$RELEASE_KIND"
52+
if [[ BUMPVERSION_DRY_RUN == "false" ]]; then
53+
git push
54+
git push --tags
55+
echo "PACKAGE=true" >> $GITHUB_ENV
56+
fi
57+
;;
58+
dev)
59+
echo "Intentionally not bumping version for dev release"
60+
;;
61+
esac
5262
5363
- name: Bump Version manual
5464
if: ${{ github.event_name == 'workflow_dispatch' }}

0 commit comments

Comments
 (0)