Skip to content

Commit dcdf75c

Browse files
committed
Add version protection
1 parent ad4500d commit dcdf75c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/continuous-deployment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ jobs:
5454
uses: actions/[email protected]
5555
with:
5656
name: tarball
57+
- id: get-version
58+
name: Get version
59+
run: echo version=`tar --extract --file=../use-memo-map-0.0.0-0.tgz --to-stdout package/package.json | jq -r .version` > $GITHUB_OUTPUT
60+
- if: ${{ contains(steps.get-version.outputs.version, '-') }}
61+
name: Validate version
62+
run: |
63+
echo Cannot publish production version
64+
exit 1
5765
- run: npm publish --tag main `ls *.tgz`
5866
env:
5967
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)