File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,12 +213,14 @@ jobs:
213213 echo "::error::No package.json files found to validate"
214214 exit 1
215215 fi
216- # Strip registry overrides from .yarnrc.yml to prevent scoped
217- # registry redirects (npmScopes.<scope>.npmRegistryServer) which
218- # take precedence over the YARN_NPM_REGISTRY_SERVER env var.
216+ # Strip registry overrides from .yarnrc.yml to prevent registry
217+ # redirects that could exfiltrate the NPM token. npmPublishRegistry
218+ # takes precedence over npmRegistryServer for yarn npm publish, and
219+ # npmScopes can override per-scope. YARN_NPM_REGISTRY_SERVER env var
220+ # only overrides npmRegistryServer, not the others.
219221 if [[ -f .yarnrc.yml ]]; then
220222 echo "Stripping registry config from .yarnrc.yml"
221- yq -i 'del(.npmRegistryServer) | del(.npmScopes)' .yarnrc.yml
223+ yq -i 'del(.npmRegistryServer) | del(.npmPublishRegistry) | del(. npmScopes)' .yarnrc.yml
222224 fi
223225 for f in "${manifests[@]}"; do
224226 # Strip lifecycle scripts that run during pack/publish
You can’t perform that action at this time.
0 commit comments