Skip to content

Commit 85ffa69

Browse files
gergeshclaude
andcommitted
Add GITHUB_TOKEN support and update git user defaults
- Add GITHUB_TOKEN env var to docker-compose.yml with entrypoint script that configures git credentials for private repo access - Update default git user config in Dockerfile 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent db7997b commit 85ffa69

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docker/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,22 @@ services:
2222
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
2323
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
2424
- OPENCODE_API_KEY=${OPENCODE_API_KEY:-}
25+
# GitHub token - enables git operations with private repos
26+
- GITHUB_TOKEN=${GITHUB_TOKEN:-}
2527
# Git user config - set these to use your own identity for commits
2628
- GIT_AUTHOR_NAME=${GIT_AUTHOR_NAME:-shuvcode}
2729
- GIT_AUTHOR_EMAIL=${GIT_AUTHOR_EMAIL:-shuvcode@localhost}
2830
- GIT_COMMITTER_NAME=${GIT_COMMITTER_NAME:-shuvcode}
2931
- GIT_COMMITTER_EMAIL=${GIT_COMMITTER_EMAIL:-shuvcode@localhost}
32+
# Configure git credentials if GITHUB_TOKEN is set, then run shuvcode
33+
entrypoint: ["/bin/sh", "-c"]
34+
command:
35+
- |
36+
if [ -n "$$GITHUB_TOKEN" ]; then
37+
git config --global credential.helper '!f() { echo username=x-access-token; echo password=$$GITHUB_TOKEN; }; f'
38+
git config --global url."https://github.com/".insteadOf "git@github.com:"
39+
fi
40+
exec shuvcode serve --port 4096 --hostname 0.0.0.0
3041
working_dir: /workspace
3142
restart: unless-stopped
3243

0 commit comments

Comments
 (0)