Fix conflicting --global/--file flags in entrypoint git config
Build Container / build-container (pull_request) Successful in 10m15s
Build Container / build-container (pull_request) Successful in 10m15s
git rejects `--global` and `--file` together ("error: only one config
file at a time"), so the credential helper and user.name/user.email
were never written — /home/claude/.gitconfig was left nonexistent and
containers had no git identity or HTTPS token helper.
Drop `--global` and keep `--file /home/claude/.gitconfig`, which is the
intended target: the entrypoint runs as root at that point, so
`--global` would have resolved to /root/.gitconfig, and the existing
`chown claude:claude /home/claude/.gitconfig` already assumes the
--file path.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -120,16 +120,16 @@ if [ -n "$GIT_TOKEN" ]; then
|
||||
echo "https://oauth2:${GIT_TOKEN}@github.com" >> "$CRED_FILE"
|
||||
echo "https://oauth2:${GIT_TOKEN}@gitlab.com" >> "$CRED_FILE"
|
||||
echo "https://oauth2:${GIT_TOKEN}@bitbucket.org" >> "$CRED_FILE"
|
||||
git config --global --file /home/claude/.gitconfig credential.helper "store --file=$CRED_FILE"
|
||||
git config --file /home/claude/.gitconfig credential.helper "store --file=$CRED_FILE"
|
||||
unset GIT_TOKEN
|
||||
fi
|
||||
|
||||
# ── Git user config ──────────────────────────────────────────────────────────
|
||||
if [ -n "$GIT_USER_NAME" ]; then
|
||||
git config --global --file /home/claude/.gitconfig user.name "$GIT_USER_NAME"
|
||||
git config --file /home/claude/.gitconfig user.name "$GIT_USER_NAME"
|
||||
fi
|
||||
if [ -n "$GIT_USER_EMAIL" ]; then
|
||||
git config --global --file /home/claude/.gitconfig user.email "$GIT_USER_EMAIL"
|
||||
git config --file /home/claude/.gitconfig user.email "$GIT_USER_EMAIL"
|
||||
fi
|
||||
chown claude:claude /home/claude/.gitconfig 2>/dev/null || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user