Skip to content

Commit 239744f

Browse files
committed
ci: retrieve the registry secret from a variable in matrix
1 parent b38495e commit 239744f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ permissions:
1212

1313
jobs:
1414
build:
15+
# allow failure publishing to npm for now
16+
# TODO: remove this once we have a token
17+
continue-on-error: ${{ matrix.registry.url == 'https://registry.npmjs.org' }}
1518
strategy:
1619
matrix:
1720
registry:
18-
# - url: https://registry.npmjs.org
19-
# token: ${{ secrets.NPM_TOKEN }}
21+
- url: https://registry.npmjs.org
22+
token_secret: NPM_TOKEN
2023
- url: https://npm.pkg.github.com
21-
token: ${{ secrets.GITHUB_TOKEN }}
24+
token_secret: GITHUB_TOKEN
2225
runs-on: ubuntu-latest
2326
steps:
2427
- name: Checkout
@@ -41,8 +44,7 @@ jobs:
4144
- name: Install dependencies
4245
run: pnpm install --frozen-lockfile --ignore-scripts
4346
env:
44-
# NODE_AUTH_TOKEN: ${{ matrix.registry.token }}
45-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
NODE_AUTH_TOKEN: ${{ secrets[matrix.registry.token_secret] }}
4648

4749
- name: Version bump
4850
# only if manual workflow dispatch and not on a tag
@@ -58,4 +60,4 @@ jobs:
5860
fi
5961
pnpm publish --access public --no-git-checks $FLAGS
6062
env:
61-
NODE_AUTH_TOKEN: ${{ matrix.registry.token }}
63+
NODE_AUTH_TOKEN: ${{ secrets[matrix.registry.token_secret] }}

0 commit comments

Comments
 (0)