Skip to content

Commit acb4725

Browse files
authored
fix: version bump logic (#102)
1 parent cd87c03 commit acb4725

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/publish.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: read
12+
contents: write
1313
packages: write
1414
steps:
1515
- uses: actions/checkout@v4
@@ -26,12 +26,19 @@ jobs:
2626
- run: echo "lines=$(git diff package.json | grep '+\s*"version"' -c)" >> $GITHUB_OUTPUT
2727
id: version-diff
2828

29+
- run: |
30+
git config --global user.name 'github-actions'
31+
git config --global user.email 'github-actions@users.noreply.github.com'
32+
2933
- run: yarn publish --minor
30-
if: ${{ steps.version-diff.outputs.lines == 1 }}
34+
if: ${{ steps.version-diff.outputs.lines == 0 }}
3135
env:
3236
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3337

3438
- run: yarn publish
35-
if: ${{ steps.version-diff.outputs.lines == 0 }}
39+
if: ${{ steps.version-diff.outputs.lines == 1 }}
3640
env:
3741
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- run: git push
44+
name: Push commit with new version

0 commit comments

Comments
 (0)