Skip to content

Commit 97ef0e8

Browse files
committed
ci: run npm auth checks from package dirs
1 parent 85145cf commit 97ef0e8

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/release-cli.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,13 @@ jobs:
255255
exit 1
256256
fi
257257
258+
pushd cli >/dev/null
258259
npm config set //registry.npmjs.org/:_authToken "${NODE_AUTH_TOKEN}"
259260
npm_user=$(npm whoami --registry "$NPM_REGISTRY_URL")
260-
echo "Authenticated to npm as ${npm_user}"
261-
262261
access_json=$(npm access list packages @truenine --json 2>/dev/null || true)
262+
popd >/dev/null
263+
264+
echo "Authenticated to npm as ${npm_user}"
263265
if [[ -z "${access_json}" || "${access_json}" == "{}" || "${access_json}" == "null" ]]; then
264266
echo "::error::Authenticated as ${npm_user}, but npm did not report package access for @truenine. Replace NPM_TOKEN with a token that has publish permission for existing @truenine/* packages."
265267
exit 1
@@ -429,12 +431,15 @@ jobs:
429431
exit 1
430432
fi
431433
434+
pushd cli >/dev/null
432435
npm config set //registry.npmjs.org/:_authToken "${NODE_AUTH_TOKEN}"
433436
npm_user=$(npm whoami --registry "$NPM_REGISTRY_URL")
437+
access_json=$(npm access list packages @truenine --json 2>/dev/null || true)
438+
package_name=$(jq -r '.name' package.json)
439+
popd >/dev/null
440+
434441
echo "Authenticated to npm as ${npm_user}"
435442
436-
access_json=$(npm access list packages @truenine --json 2>/dev/null || true)
437-
package_name=$(jq -r '.name' cli/package.json)
438443
package_access=$(jq -r --arg package_name "$package_name" '.[$package_name] // empty' <<<"${access_json:-{}}")
439444
440445
if [[ "$package_access" != "read-write" ]]; then
@@ -523,12 +528,15 @@ jobs:
523528
exit 1
524529
fi
525530
531+
pushd mcp >/dev/null
526532
npm config set //registry.npmjs.org/:_authToken "${NODE_AUTH_TOKEN}"
527533
npm_user=$(npm whoami --registry "$NPM_REGISTRY_URL")
534+
access_json=$(npm access list packages @truenine --json 2>/dev/null || true)
535+
package_name=$(jq -r '.name' package.json)
536+
popd >/dev/null
537+
528538
echo "Authenticated to npm as ${npm_user}"
529539
530-
access_json=$(npm access list packages @truenine --json 2>/dev/null || true)
531-
package_name=$(jq -r '.name' mcp/package.json)
532540
package_access=$(jq -r --arg package_name "$package_name" '.[$package_name] // empty' <<<"${access_json:-{}}")
533541
534542
if [[ "$package_access" != "read-write" ]]; then

0 commit comments

Comments
 (0)