Skip to content

Commit a838f76

Browse files
z-brCryptoGraffeclaude
authored
feat: add GitHub token authentication to git clone (#20)
Update git clone command to use token-based authentication for private repositories. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: graffe <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 2210712 commit a838f76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/utils/code_task_v2.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,10 @@ def _run_ai_code_task_v2_internal(task_id: int, user_id: str, github_token: str)
243243
set -e
244244
echo "Setting up repository..."
245245
246-
# Clone repository
247-
git clone -b {task['target_branch']} {task['repo_url']} /workspace/repo
246+
# Clone repository with authentication
247+
# Convert GitHub URL to use token authentication
248+
REPO_URL_WITH_TOKEN=$(echo "{task['repo_url']}" | sed "s|https://github.com/|https://{github_token}@github.com/|")
249+
git clone -b {task['target_branch']} "$REPO_URL_WITH_TOKEN" /workspace/repo
248250
cd /workspace/repo
249251
250252
# Configure git

0 commit comments

Comments
 (0)