Skip to content

Commit 5215810

Browse files
Fix auth on npm publish (#1103)
* check NODE_AUTH_TOKEN is available or not Signed-off-by: msivasubramaniaan <msivasub@redhat.com> * set NODE_AUTH_TOKEN * set npmAuthToken $NODE_AUTH_TOKEN * set npmAuthToken $NODE_AUTH_TOKEN * all the required parameters are set --------- Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
1 parent eddfce5 commit 5215810

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/CI.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ jobs:
7676
- name: Publish
7777
if: ${{ success() && runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/main'}}
7878
run: |
79-
yarn config set npmAuthToken $NODE_AUTH_TOKEN
79+
yarn config set npmRegistryServer "https://registry.npmjs.org"
80+
yarn config set npmAlwaysAuth true
81+
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
8082
yarn publish --tag next --no-git-tag-version --prepatch --preid "$(git rev-parse --short HEAD)"
8183
env:
8284
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ jobs:
4545
run: yarn check-dependencies
4646

4747
- name: Set Publish Auth
48-
run: yarn config set npmAuthToken $NODE_AUTH_TOKEN
48+
run: |
49+
yarn config set npmRegistryServer "https://registry.npmjs.org"
50+
yarn config set npmAlwaysAuth true
51+
yarn config set npmAuthToken ${{ secrets.NPM_TOKEN }}
4952
5053
#Publish to npm
5154
- name: Publish to npm

0 commit comments

Comments
 (0)