fix: use x-access-token username for HTTPS git auth (GitHub compatibility)

x-token-auth is Bitbucket/Gitea-specific; GitHub doesn't recognise it and
returns a misleading 403 'Write access not granted'. x-access-token is the
username GitHub documents for PAT auth and is also accepted by GitLab/Gitea.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
Claude 2026-03-26 08:41:54 +00:00
parent def40aa7f9
commit c7ed5cfe95
No known key found for this signature in database

View file

@ -27,7 +27,7 @@ CLONE_URL="$REPO_URL"
if [ -n "${GIT_TOKEN:-}" ]; then if [ -n "${GIT_TOKEN:-}" ]; then
case "$REPO_URL" in case "$REPO_URL" in
https://*) https://*)
CLONE_URL="https://x-token-auth:${GIT_TOKEN}@${REPO_URL#https://}" CLONE_URL="https://x-access-token:${GIT_TOKEN}@${REPO_URL#https://}"
;; ;;
esac esac
fi fi