Skip to content

Commit 8af29fe

Browse files
committed
Fix NPM package push
1 parent 6a194b9 commit 8af29fe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ jobs:
2929
echo "NUGET_API_KEY_DEFINED=true" >> $env:GITHUB_ENV
3030
}
3131
32+
if ('${{ secrets.NPM_API_KEY }}') {
33+
Write-Host "NPM_API_KEY secret detected. NPM packages will be pushed."
34+
echo "NPM_API_KEY_DEFINED=true" >> $env:GITHUB_ENV
35+
}
36+
3237
- name: 🔎 Search for build of ${{ github.ref }}
3338
shell: pwsh
3439
id: findrunid
@@ -107,10 +112,10 @@ jobs:
107112
if: ${{ env.NUGET_API_KEY_DEFINED == 'true' }}
108113

109114
- name: 🚀 Push NPM packages
115+
shell: pwsh
110116
run: |
111-
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_API_KEY }}
117+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_API_KEY }}
112118
Get-ChildItem '${{ runner.temp }}/deployables/*.tgz' |% {
113119
npm publish $_ --registry=https://registry.npmjs.org/
114120
}
115-
env:
116-
NPM_AUTH_TOKEN: ${{ secrets.NPM_API_KEY }}
121+
if: ${{ env.NPM_API_KEY_DEFINED == 'true' }}

0 commit comments

Comments
 (0)