Skip to content
This repository was archived by the owner on Nov 16, 2025. It is now read-only.

Commit 1846cb0

Browse files
committed
ci: detect if bump is needed
1 parent 88124e0 commit 1846cb0

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,19 @@ jobs:
4949
run: |
5050
pip install .
5151
52-
- name: Generate release
52+
- name: Check if bump is needed
53+
id: bump_check
54+
run: |
55+
if cz bump --dry-run; then
56+
echo "bump_needed=true" >> $GITHUB_ENV
57+
else
58+
echo "bump_needed=false" >> $GITHUB_ENV
59+
fi
60+
61+
- name: Bump version and push tag
5362
env:
5463
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
if: env.bump_needed == 'true'
5565
run: |
5666
git config user.name "github-actions[bot]"
5767
git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -60,10 +70,9 @@ jobs:
6070
git push --tags
6171
6272
release:
63-
name: Create GitHub Release
6473
runs-on: ubuntu-latest
6574
needs: bump
66-
if: github.ref_type == 'tag'
75+
if: env.bump_needed == 'true' && github.ref_type == 'tag'
6776
steps:
6877
- name: Create GitHub Release
6978
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)