File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 3535 node-version : ' 24'
3636 registry-url : ' https://registry.npmjs.org'
3737
38+ # Check if version already published
39+ - name : Check if version exists
40+ id : version-check
41+ run : |
42+ PACKAGE_NAME=$(node -p "require('./package.json').name")
43+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
44+ if npm view "${PACKAGE_NAME}@${PACKAGE_VERSION}" version 2>/dev/null; then
45+ echo "exists=true" >> $GITHUB_OUTPUT
46+ echo "Version ${PACKAGE_VERSION} already published, skipping..."
47+ else
48+ echo "exists=false" >> $GITHUB_OUTPUT
49+ echo "Version ${PACKAGE_VERSION} not found, will publish..."
50+ fi
51+
3852 # Trusted Publishing via OIDC - no token needed!
3953 # See: https://docs.npmjs.com/trusted-publishers/
4054 - name : Publish to npm
55+ if : steps.version-check.outputs.exists == 'false'
4156 run : npm publish --access public --provenance
You can’t perform that action at this time.
0 commit comments