Skip to content

Commit 91cadfd

Browse files
committed
shellcheck: fix SC2259 in step-7 — use env var instead of stdin pipe for GitHub token injection
Heredoc (<<'PYEOF') overrides piped stdin, so `printf ... | python3 - <<'PYEOF'` discards the pipe. Pass token via GITHUB_TOKEN_VALUE env var and read from os.environ in the Python script instead.
1 parent 060a1ea commit 91cadfd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

step-7/step-7-install.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ install_github() {
181181

182182
# Inject the token directly into the config entry (claude mcp add --scope user
183183
# does not support -e flags in all CLI versions, so we patch the env block).
184-
# Token is passed via stdin (not argv) to avoid leaking it in `ps` output.
185-
printf '%s' "$GITHUB_TOKEN" | python3 - <<'PYEOF'
186-
import sys, json, os
184+
# Token is passed via env var (not argv) to avoid leaking it in `ps` output.
185+
GITHUB_TOKEN_VALUE="$GITHUB_TOKEN" python3 - <<'PYEOF'
186+
import json, os
187187
188-
token = sys.stdin.read().strip()
188+
token = os.environ.get("GITHUB_TOKEN_VALUE", "").strip()
189189
config_path = os.path.expanduser("~/.claude.json")
190190
191191
with open(config_path) as f:

0 commit comments

Comments
 (0)