chore(ci): fix sync push auth shadowed by checkout credentials#60742
Merged
Conversation
actions/checkout persists the default GITHUB_TOKEN as an http.extraheader, which shadowed the app-token credentials embedded in the push remote URL, so the foss/private sync pushes authenticated as github-actions[bot] (403 on posthog-foss, 404 on posthog-private) instead of the sync apps. Set persist-credentials: false so the app token in the remote URL is used; posthog is public, so the partial-clone lazy blob fetches still work unauthenticated.
Contributor
|
Reviews (1): Last reviewed commit: "chore(ci): fix sync push auth shadowed b..." | Re-trigger Greptile |
feliperalmeida
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The sync rework in #60583 broke production foss-sync and private-sync — both fail at the push step:
foss-sync:Permission to posthog/posthog-foss.git denied to github-actions[bot](403)private-sync:Repository not found(404 — the default token can't see the private repo)actions/checkoutpersists the defaultGITHUB_TOKENas anhttp.https://github.com/.extraheader. ThatAuthorizationheader shadows the app-token credentials embedded in the push remote URL, so both pushes authenticate asgithub-actions[bot]instead of theposthog-foss-sync/posthog-private-syncapps. The oldPostHog/git-syncDocker action never hit this because it ran a fresh clone with no checkout extraheader.posthog-foss and posthog-private have stopped receiving updates until this lands. master on those repos is not corrupted — both runs failed at the first push, so nothing was half-written.
Changes
Add
persist-credentials: falseto the posthog checkout in bothfoss-sync.ymlandprivate-sync.yml. This removes the shadowing auth header, so the app token embedded in the push remote URL is the one used. posthog is public, so the partial-clone (blob:none) lazy blob fetches still work unauthenticated.How did you test this code?
I'm an agent — no manual end-to-end run (these workflows only trigger on push to posthog master and can't run from a PR/fork).
python3 -c "import yaml; yaml.safe_load(...)").blob:nonepartial clone of posthog pushed to a throwaway branch on posthog-foss — it succeeded, precisely because a manual clone has noactions/checkoutextraheader.persist-credentials: falsereproduces that same condition in CI.End-to-end confirmation will come from the first post-merge run on master.
Automatic notifications
🤖 Agent context
Authored by Claude Code at the maintainer's direction. Root-caused from the failing run logs: the 403/404 identities (
github-actions[bot]) showed the push used the default token, not the app token in the remote URL — the signature ofactions/checkout's persistedhttp.extraheadershadowing URL credentials.Alternatives considered and rejected: a per-remote
http.<url>.extraheaderoverride (git sends all matching extraheaders, producing twoAuthorizationheaders) and unsetting the generic extraheader before each push (equivalent effect, more fragile).persist-credentials: falseis the standard, minimal fix; lazy blob fetches stay anonymous because posthog is public.Note: this commit is unsigned — the maintainer's commit-signing key (Secretive, Touch ID) can't be driven from the agent environment. Re-sign via amend from a local terminal if signed commits are required to merge.