Skip to content

Commit

Permalink
update workflow;
Browse files Browse the repository at this point in the history
  • Loading branch information
ricki-epsilla committed Dec 6, 2023
1 parent 747ed66 commit 6020404
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/npm-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@ jobs:
id: package_version
run: echo "::set-output name=VERSION::$(node -p "require('./package.json').version")"

- name: Check npm view
run: |
VERSION=${{ steps.package_version.outputs.VERSION }}
echo "Checking version $VERSION"
npm view epsillajs@$VERSION
- name: Check if version already published
run: |
VERSION=${{ steps.package_version.outputs.VERSION }}
if npm view epsillajs@$VERSION; then
echo "Checking version: $VERSION"
NPM_VIEW_OUTPUT=$(npm view epsillajs@$VERSION)
echo "npm view output: $NPM_VIEW_OUTPUT"
if [ -n "$NPM_VIEW_OUTPUT" ]; then
echo "Version $VERSION already exists on npm. Please update the version."
exit 1
fi
Expand Down

0 comments on commit 6020404

Please sign in to comment.