Skip to content

Commit da4c50c

Browse files
ci: rewrite lockfile resolved: URLs to JFrog in setup-jfrog
npm ci honors the lockfile's resolved: URL over .npmrc's registry setting. Protected runners cannot reach registry.npmjs.org directly, so any package not already in the ~/.npm cache hangs ~8 minutes before being killed with "Exit handler never called", which silently skips bin-linking and breaks downstream `nyc`/`prettier` calls. Rewrite the lockfile in-place after configuring the JFrog registry so npm fetches via the proxy. Committed lockfile stays in standard public-npm form so contributors can `npm ci` locally without JFrog auth. Co-authored-by: Isaac
1 parent 8fb192a commit da4c50c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/actions/setup-jfrog/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,21 @@ runs:
3434
always-auth=true
3535
EOF
3636
echo "npm configured to use JFrog registry"
37+
38+
# Rewrite lockfile `resolved:` URLs to JFrog. `npm ci` honors the
39+
# lockfile's `resolved:` URL over the `.npmrc` registry; protected
40+
# runners cannot reach `registry.npmjs.org` directly, so without
41+
# this rewrite npm hangs ~8 minutes on any package not already in
42+
# the `~/.npm` cache, then dies with "Exit handler never called".
43+
# The committed lockfile is kept in standard form (public-npm URLs)
44+
# so contributors can `npm ci` locally; this step adapts it for CI.
45+
- name: Rewrite lockfile to JFrog registry
46+
shell: bash
47+
run: |
48+
set -euo pipefail
49+
if [ -f package-lock.json ]; then
50+
sed -i 's|https://registry.npmjs.org|https://databricks.jfrog.io/artifactory/api/npm/db-npm|g' package-lock.json
51+
echo "package-lock.json resolved: URLs rewritten to JFrog"
52+
else
53+
echo "no package-lock.json found; skipping rewrite"
54+
fi

0 commit comments

Comments
 (0)