Skip to content

Commit d66cccc

Browse files
committed
fix: resolve duplicate Authorization header in release workflow
Checkout with the GitHub App token directly instead of manually setting http.extraheader after checkout. The previous approach added a second Authorization header on top of the one persisted by actions/checkout, causing GitHub to reject git fetches with HTTP 400. Signed-off-by: Gorkem Ercan <gorkem.ercan@gmail.com>
1 parent 2ec8244 commit d66cccc

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/platform-release.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,21 @@ jobs:
176176
runs-on: ubuntu-latest
177177
needs: [build-linux, build-macos, build-windows]
178178
steps:
179-
# checkout the current repository
179+
- name: Generate a token for docs update PR
180+
id: generate-token
181+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 ## v3.0.0
182+
with:
183+
app-id: ${{ vars.KITOPS_BOT_ID }}
184+
private-key: ${{ secrets.KITOPS_BOT_PRIVATE_KEY }}
185+
owner: kitops-ml
186+
187+
# checkout the current repository using the App token
188+
# so that git credentials are set correctly for the docs update PR
180189
- name: Checkout kitops
181190
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
182191
with:
183192
path: kitops
193+
token: ${{ steps.generate-token.outputs.token }}
184194

185195
# Create the homebrew-file directory to store the
186196
# homebrew artifacts and copy the awk script and
@@ -248,22 +258,13 @@ jobs:
248258
fi
249259
gh release create "${release_args[@]}"
250260
251-
- name: Generate a token for docs update PR
252-
id: generate-token
253-
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 ## v3.0.0
254-
with:
255-
app-id: ${{ vars.KITOPS_BOT_ID }}
256-
private-key: ${{ secrets.KITOPS_BOT_PRIVATE_KEY }}
257-
owner: kitops-ml
258-
259261
- name: Generate CLI documentation
260262
shell: bash
261263
env:
262264
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
263265
TAG_NAME: ${{ inputs.release_tag || github.ref_name}}
264266
run: |
265267
pushd kitops
266-
git config --local http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n "x-access-token:${GITHUB_TOKEN}" | base64)"
267268
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
268269
PR_BRANCH="${{ github.ref_name }}-docs-update"
269270
git fetch origin main

0 commit comments

Comments
 (0)