Skip to content

Commit

Permalink
fix npm notice err
Browse files Browse the repository at this point in the history
  • Loading branch information
avifenesh committed Jun 2, 2024
1 parent 1f3754e commit 2668c6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/npm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ jobs:
npm pkg fix
set +e
# 2>&1 1>&3- redirects stderr to stdout and then redirects the original stdout to another file descriptor,
# effectively separating stderr and stdout. The 3>&1 at the end redirects the original stdout back to the console.
{ npm_publish_err=$(npm publish --tag ${{ env.NPM_TAG }} --access public 2>&1 1>&3-) ;} 3>&1
# effectively separating stderr and stdout. The 3>&1 at the end redirects the original stdout back to the console.
# https://github.com/npm/npm/issues/118#issuecomment-325440 - ignoring notice messages since currentlly they are directed to stderr
{ npm_publish_err=$(npm publish --tag ${{ env.NPM_TAG }} --access public 2>&1 1>&3- | grep -v "notice") ;} 3>&1
if [[ "$npm_publish_err" == *"You cannot publish over the previously published versions"* ]]
then
echo "Skipping publishing, package already published"
Expand Down

0 comments on commit 2668c6b

Please sign in to comment.