Skip to content

Commit e7882f1

Browse files
committed
fix: harden claude-runner entrypoint for real execution
- Use GITHUB_TOKEN env var directly (gh auto-detects it) - Full clone instead of shallow (shallow breaks gh pr checkout) - Add --verbose flag (required for stream-json output) - Add non-root user to Dockerfile
1 parent be88c89 commit e7882f1

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

infra/docker/claude-runner/entrypoint.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
# Authenticate with GitHub using the injected token
5-
echo "$GITHUB_TOKEN" | gh auth login --with-token
4+
# gh CLI auto-detects GITHUB_TOKEN env var -- no explicit login needed.
5+
# Verify it works:
6+
gh auth status > /dev/null 2>&1 || {
7+
echo "ERROR: GitHub authentication failed" >&2
8+
exit 1
9+
}
610

7-
# Clone the repo (shallow) and check out the PR branch
8-
gh repo clone "$REPO_FULL_NAME" /workspace -- --depth=1
11+
# Clone the repo and check out the PR branch
12+
gh repo clone "$REPO_FULL_NAME" /workspace
913
cd /workspace
1014
gh pr checkout "$PR_NUMBER"
1115

@@ -37,6 +41,7 @@ PROMPT="${PROMPT//\{\{PR_DIFF\}\}/$PR_DIFF}"
3741
exec claude \
3842
--print \
3943
--dangerously-skip-permissions \
44+
--verbose \
4045
--output-format stream-json \
4146
--max-turns 15 \
4247
"$PROMPT"

0 commit comments

Comments
 (0)