File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -41,14 +41,26 @@ jobs:
4141 - name : Test
4242 run : pnpm test:run
4343
44- - name : Create Release Pull Request or Publish
45- id : changesets
44+ - name : Check if version exists on npm
45+ id : check
46+ run : |
47+ CURRENT_VERSION=$(node -p "require('./package.json').version")
48+ echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
49+ if npm view boxfix@$CURRENT_VERSION > /dev/null 2>&1; then
50+ echo "exists=true" >> $GITHUB_OUTPUT
51+ else
52+ echo "exists=false" >> $GITHUB_OUTPUT
53+ fi
54+
55+ - name : Publish to npm
56+ if : steps.check.outputs.exists == 'false'
57+ run : npm publish --provenance --access public
58+
59+ - name : Create Release Pull Request
4660 uses : changesets/action@v1
4761 with :
48- publish : pnpm release
4962 version : pnpm changeset version
5063 title : ' chore: version packages'
5164 commit : ' chore: version packages'
5265 env :
5366 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54- NPM_CONFIG_PROVENANCE : true
You can’t perform that action at this time.
0 commit comments