diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index c69af16277..ff7ef9b5df 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -92,7 +92,10 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" # Configure authentication (token in memory only) - git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${GITHUB_TOKEN} | base64)" + # Use `base64 -w0`: plain `base64` wraps lines at 76 chars, and the + # current GITHUB_TOKEN is long enough that wrapping inserts newlines + # into the header value, which GitHub rejects (HTTP/2 stream reset). + git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 -w0)" # Deploy using ghp-import (includes dotfiles like .asf.yaml and .nojekyll) echo "Creating asf-staging branch..." diff --git a/.github/workflows/promote-staging-to-production.yml b/.github/workflows/promote-staging-to-production.yml index 02aeaae96c..d5990d88b9 100644 --- a/.github/workflows/promote-staging-to-production.yml +++ b/.github/workflows/promote-staging-to-production.yml @@ -63,7 +63,10 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${GITHUB_TOKEN} | base64)" + # Use `base64 -w0`: plain `base64` wraps lines at 76 chars, and the + # current GITHUB_TOKEN is long enough that wrapping inserts newlines + # into the header value, which GitHub rejects (HTTP/2 stream reset). + git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(printf 'x-access-token:%s' "${GITHUB_TOKEN}" | base64 -w0)" # Push asf-staging to asf-site (replace production with staging content) git push https://github.com/${GITHUB_REPOSITORY}.git origin/asf-staging:asf-site --force