Skip to content

Commit d08646d

Browse files
authored
Update npm-publish.yml
Updated to only push a new update if the version is changed.
1 parent cb12afe commit d08646d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,19 @@ jobs:
2828
with:
2929
node-version: 20
3030
registry-url: https://registry.npmjs.org/
31+
- name: Check package version
32+
id: cpv
33+
uses: PostHog/check-package-version@v2
34+
with:
35+
path: '.'
36+
- name: Show version info
37+
run: |
38+
echo "Committed version: ${{ steps.cpv.outputs.committed-version }}"
39+
echo "Published version: ${{ steps.cpv.outputs.published-version }}"
40+
echo "Is new version: ${{ steps.cpv.outputs.is-new-version }}"
3141
- run: npm ci
32-
- run: npm publish --access public
42+
- name: Publish new version
43+
if: steps.cpv.outputs.is-new-version == 'true'
44+
run: npm publish --access public
3345
env:
3446
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)