Skip to content

Commit ff2e525

Browse files
maximizeITGitHub Copilot
andcommitted
fix(ci): expand NODE_AUTH_TOKEN placeholder for Yarn classic GitHub Packages auth
widget-sdk@3.18.0 is published to GitHub Packages (npm.pkg.github.com), unlike 3.17.0 which was on the public npm registry and needed no auth. actions/setup-node writes the literal string '${NODE_AUTH_TOKEN}' into the temp npmrc file (NPM_CONFIG_USERCONFIG). The npm CLI expands env-var references from .npmrc; Yarn classic (v1) does NOT — so every yarn install sent the literal '${NODE_AUTH_TOKEN}' as the Bearer token, causing 401. Fix: expand the placeholder in-place with sed before running yarn install, in the same step where NODE_AUTH_TOKEN is defined in env. Co-authored-by: GitHub Copilot <copilot@noreply.github.com>
1 parent 59d5a4d commit ff2e525

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ jobs:
2525

2626
- name: Install Yarn Dependencies
2727
working-directory: samples/weather-forecast
28-
run: yarn install --frozen-lockfile
28+
# actions/setup-node writes `${NODE_AUTH_TOKEN}` as a literal string into
29+
# the temp npmrc (NPM_CONFIG_USERCONFIG). npm expands env-var references;
30+
# Yarn classic (v1) does NOT. Replace the placeholder in-place so Yarn
31+
# receives the actual token when fetching from npm.pkg.github.com.
32+
run: |
33+
sed -i "s|\${NODE_AUTH_TOKEN}|${NODE_AUTH_TOKEN}|" "$NPM_CONFIG_USERCONFIG"
34+
yarn install --frozen-lockfile
2935
env:
3036
NODE_AUTH_TOKEN: ${{ secrets.STAFFBOT_NPM_READ }}
3137

0 commit comments

Comments
 (0)