From 2aff1e45a469b4d18c4ea47155a7c55f3aea10f1 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Fri, 6 Feb 2026 00:32:59 +0100 Subject: [PATCH] circleci: fix docs push auth (#914) In commit 4f950bb60 we switched the publish workflow to use HTTPS and changed CircleCI config accordingly. However, that wasn't working. The error we get after merge to `master`, when we run the job, is: `The key you are authenticating with has been marked as read only.` The reason is that CircleCI configures SSH URL rewriting, which takes precedence. Fix by using git's `url..insteadOf` config to rewrite both HTTPS and SSH URLs to use HTTPS with the GitHub token. This ensures the token is used regardless of any SSH configuration. --------- Co-authored-by: Claude Opus 4.5 --- .circleci/config.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62088e3..14c158d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,16 +68,19 @@ commands: git config --global user.email "zreplbot@cschwarz.com" git config --global user.name "zrepl-github-io-ci" - # Configure git to use the GitHub token for HTTPS authentication - # The token is stored in the 'zrepl-github-io-deploy' context + # Configure git to use the GitHub token for HTTPS authentication. + # The token is stored in the 'zrepl-github-io-deploy' context. - when: condition: << parameters.push >> steps: - run: - name: Configure git credential helper for GitHub token + name: Configure git to use GitHub token for push # GITHUB_PAGES_TOKEN is from the 'zrepl-github-io-deploy' context. # CircleCI's secret masking automatically redacts context variables in logs. command: | + # Unset CircleCI's SSH URL rewriting that checkout step configured + git config --global --unset-all url."ssh://git@github.com".insteadOf || true + # Set up credential helper with GitHub token git config --global credential.helper store echo "https://x-access-token:${GITHUB_PAGES_TOKEN}@github.com" > ~/.git-credentials chmod 600 ~/.git-credentials