🏷️ ci: Fix Helm Tag Sync Git Auth (#13460)

This commit is contained in:
Danny Avila 2026-06-01 18:32:38 -04:00 committed by GitHub
parent 2ab432bd0a
commit 67398e0a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -17,9 +17,14 @@ fail() {
exit 1
}
git_auth_header() {
token="$(printf 'x-access-token:%s' "$GITHUB_TOKEN" | base64 | tr -d '\n')"
printf 'AUTHORIZATION: basic %s' "$token"
}
git_with_auth() {
if [ -n "${GITHUB_TOKEN:-}" ]; then
git -c "http.${GITHUB_SERVER_URL}/.extraheader=AUTHORIZATION: bearer ${GITHUB_TOKEN}" "$@"
git -c "http.extraheader=$(git_auth_header)" "$@"
return
fi