Skip to content

Commit

Permalink
🐛 fix: Fix exit code 1 when .npmrc does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
honzabubenik committed Sep 5, 2024
1 parent e48e151 commit 250716b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ runs:
NPMRC_AUTH_EXISTS=$(grep -c _auth .npmrc)
if [ ${NPMRC_AUTH_EXISTS:-0} == 0 ] && [ $NPM_TOKEN != '' ]; then npm config set _auth=$NPM_TOKEN --location=project; fi
npm publish --registry=${{ inputs.npm-private-registry }}
rm .npmrc
git checkout .npmrc || true
rm .npmrc 2> /dev/null || true
git checkout .npmrc 2> /dev/null || true
shell: bash

- if: inputs.npm-publish == 'public'
Expand All @@ -157,8 +157,8 @@ runs:
npm config set "//registry.npmjs.org/:_authToken=${{ inputs.npm-token }}" --location=project
if [ ${{ inputs.node-version }} == 16* ]; then npm config set "always-auth=true" --location=project; fi
npm publish --access=public
rm .npmrc
git checkout .npmrc || true
rm .npmrc 2> /dev/null || true
git checkout .npmrc 2> /dev/null || true
shell: bash

- if: inputs.monorepo-npm-install != 'false'
Expand Down Expand Up @@ -194,8 +194,8 @@ runs:
NPMRC_AUTH_EXISTS=$(grep -c _auth .npmrc)
if [ ${NPMRC_AUTH_EXISTS:-0} == 0 ] && [ $NPM_TOKEN != '' ]; then npm config set _auth=$NPM_TOKEN --location=project; fi
npm publish --registry=${{ inputs.npm-private-registry }}
rm .npmrc
git checkout .npmrc || true
rm .npmrc 2> /dev/null || true
git checkout .npmrc 2> /dev/null || true
done
shell: bash

Expand All @@ -210,8 +210,8 @@ runs:
npm config set "//registry.npmjs.org/:_authToken=${{ inputs.monorepo-public-npm-token }}" --location=project
if [ ${{ inputs.node-version }} == 16* ]; then npm config set "always-auth=true" --location=project; fi
npm publish --access=public
rm .npmrc
git checkout .npmrc || true
rm .npmrc 2> /dev/null || true
git checkout .npmrc 2> /dev/null || true
done
shell: bash

Expand Down
4 changes: 2 additions & 2 deletions setup-npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ runs:

- run: |
npm ci
rm .npmrc 2> /dev/null
rm .npmrc 2> /dev/null || true
npm i -D conventional-changelog@5 conventional-changelog-cli@4 conventional-recommended-bump@9 @localazy/conventional-changelog-preset https://github.com/localazy/conventional-changelog-writer.git
git checkout .npmrc 2> /dev/null
git checkout .npmrc 2> /dev/null || true
shell: bash
- run: echo -e "\n${{env.blue}}=== Run code after install ===\n"
Expand Down

0 comments on commit 250716b

Please sign in to comment.