Skip to content

Commit e9b6579

Browse files
committed
no-mistakes(document): document --publish credential prerequisites; fix shellcheck tr classes
1 parent fbe28c9 commit e9b6579

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎scripts/package-npm.sh‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
# Usage:
1515
# ./scripts/package-npm.sh # pack only
1616
# ./scripts/package-npm.sh --publish # also publish to npmjs.com
17+
#
18+
# --publish checks both registries' credentials before doing any work, so it
19+
# needs a terminal: an expired npm session is renewed with an interactive
20+
# `npm login` (the account has 2FA). The MCP Registry is reached with the token
21+
# from `gh auth token`, which must carry read:org; set CODEGRAPH_MCP_TOKEN to
22+
# use a PAT limited to that scope instead. Packing alone needs no credentials.
1723

1824
set -euo pipefail
1925

@@ -122,7 +128,7 @@ if [ "${1:-}" = "--publish" ]; then
122128

123129
if [ -z "$mcp_owner" ]; then
124130
echo " ⚠ $MCP_NAMESPACE is not an io.github.* namespace - ownership not checked"
125-
elif [ "$(printf '%s' "$mcp_owner" | tr 'A-Z' 'a-z')" = "$(printf '%s' "$gh_login" | tr 'A-Z' 'a-z')" ]; then
131+
elif [ "$(printf '%s' "$mcp_owner" | tr '[:upper:]' '[:lower:]')" = "$(printf '%s' "$gh_login" | tr '[:upper:]' '[:lower:]')" ]; then
126132
echo " ✓ $MCP_NAMESPACE is the token's own user namespace ($gh_login)"
127133
else
128134
gh_status="$(gh_api 'user/memberships/orgs?per_page=100')"

0 commit comments

Comments
 (0)