Skip to content

Commit 21c53cf

Browse files
AbirAbbasclaude
andcommitted
fix: use --force flag for gh auth setup-git in Docker build
gh auth setup-git requires an authenticated session, which doesn't exist during docker build. The --force flag with --hostname skips the auth check and configures the credential helper anyway. At runtime, GH_TOKEN env var provides the actual credentials. Verified locally: docker build succeeds, git ls-remote against a private repo works with GH_TOKEN. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5177902 commit 21c53cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ENV GIT_AUTHOR_NAME="SWE-AF" \
3333
# HTTPS operations (clone, push, fetch) authenticate via GH_TOKEN at runtime.
3434
RUN git config --global user.name "SWE-AF" && \
3535
git config --global user.email "contact@agentfield.com" && \
36-
gh auth setup-git
36+
gh auth setup-git --hostname github.com --force
3737

3838
# Install uv for fast package installation
3939
RUN pip install --no-cache-dir uv

0 commit comments

Comments
 (0)