Skip to content

Commit

Permalink
update workflow due to deprecated command 'set-output';
Browse files Browse the repository at this point in the history
  • Loading branch information
ricki-epsilla committed Dec 6, 2023
1 parent 6020404 commit 09ef4d6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/npm-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,15 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Extract version from package.json
id: package_version
run: echo "::set-output name=VERSION::$(node -p "require('./package.json').version")"
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: Check if version already published
run: |
VERSION=${{ steps.package_version.outputs.VERSION }}
echo "Checking version: $VERSION"
NPM_VIEW_OUTPUT=$(npm view epsillajs@$VERSION)
echo "Checking version: ${{ env.VERSION }}"
NPM_VIEW_OUTPUT=$(npm view epsillajs@${{ env.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."
echo "Version ${{ env.VERSION }} already exists on npm. Please update the version."
exit 1
fi
Expand All @@ -59,7 +57,7 @@ jobs:
with:
github_token: ${{ secrets.PAT_TOKEN }}
tag_prefix: "v"
custom_tag: ${{ steps.package_version.outputs.VERSION }}
custom_tag: ${{ env.VERSION }}
dry_run: false

- name: Publish to npm
Expand Down

0 comments on commit 09ef4d6

Please sign in to comment.