fix(ci): use http.extraheader instead of credential helper

The credential helper approach fails because GITHUB_TOKEN env var is
not available when git push runs inside collection-docs-action. Switch
to http.extraheader which embeds the auth as a static git config value,
matching the approach checkout v4 used.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2026-07-07 10:34:10 +02:00
parent 8397a84d3e
commit a13ef97372
2 changed files with 6 additions and 4 deletions

View File

@@ -53,8 +53,9 @@ jobs:
- name: Set up git credentials for gh-pages push - name: Set up git credentials for gh-pages push
run: | run: |
cd ${{ env.collection_dir }} cd ${{ env.collection_dir }}
git config credential.helper \ BASIC_AUTH=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
'!f() { echo "username=x-access-token"; echo "password=${GITHUB_TOKEN}"; }; f' git config --local http.https://github.com/.extraheader \
"AUTHORIZATION: basic ${BASIC_AUTH}"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -60,8 +60,9 @@ jobs:
- name: Set up git credentials - name: Set up git credentials
run: | run: |
git config credential.helper \ BASIC_AUTH=$(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)
'!f() { echo "username=x-access-token"; echo "password=${GITHUB_TOKEN}"; }; f' git config --local http.https://github.com/.extraheader \
"AUTHORIZATION: basic ${BASIC_AUTH}"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}