Skip to content

Commit

Permalink
fix: npm login before npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat committed Jun 1, 2024
1 parent d3e6c5c commit 9a8249d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ if [[ "$YARN_MAJOR" -ge "3" ]]; then
PACK_CMD="yarn pack --out /tmp/%s-%v.tgz"
# install is handled by yarn berry pack/publish
INSTALL_CMD=""
LOGIN_CMD=""

Check warning on line 14 in scripts/publish.sh

View workflow job for this annotation

GitHub Actions / __fearphage_shellcheck-action

scripts/publish.sh#L14

LOGIN_CMD appears unused. Verify use (or export if used externally).
else
echo "Warning: Did not detect compatible yarn version. This action officially supports Yarn v3 and newer. Falling back to using npm." >&2
export npm_config__auth="$YARN_NPM_AUTH_TOKEN"
echo "//registry.npmjs.org/:_authToken=${YARN_NPM_AUTH_TOKEN}" >> $HOME/.npmrc

Check notice on line 17 in scripts/publish.sh

View workflow job for this annotation

GitHub Actions / __fearphage_shellcheck-action

scripts/publish.sh#L17

Double quote to prevent globbing and word splitting.
PUBLISH_CMD="npm publish --tag $PUBLISH_NPM_TAG"
PACK_CMD="npm pack --pack-destination=/tmp/"
if [[ -f 'yarn.lock' ]]; then
Expand Down Expand Up @@ -51,3 +52,4 @@ fi

$INSTALL_CMD
$PUBLISH_CMD
rm -f $HOME/.npmrc

Check notice on line 55 in scripts/publish.sh

View workflow job for this annotation

GitHub Actions / __fearphage_shellcheck-action

scripts/publish.sh#L55

Double quote to prevent globbing and word splitting.

0 comments on commit 9a8249d

Please sign in to comment.