Fix configureGitAuth for actions/checkout@v6 credential storage#920
Open
StuporHero wants to merge 1 commit intoanthropics:mainfrom
Open
Fix configureGitAuth for actions/checkout@v6 credential storage#920StuporHero wants to merge 1 commit intoanthropics:mainfrom
StuporHero wants to merge 1 commit intoanthropics:mainfrom
Conversation
actions/checkout@v6 changed persist-credentials to store the extraheader in a separate config file included via includeIf.gitdir, rather than setting it directly in the local git config. configureGitAuth only cleared extraheaders from the local config via git config --unset-all, leaving the includeIf-based credentials in place. The read-only GITHUB_TOKEN extraheader then took precedence over the app token in the remote URL, causing 403 on git push. Now also removes includeIf.gitdir entries and their associated credential config files. Fixes anthropics#907
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.
Summary
Problem
actions/checkout@v6 (https://github.com/actions/checkout/releases/tag/v6.0.0, PR actions/checkout#2286) changed how
persist-credentials works. Instead of setting http.*.extraheader directly in the local git config, it writes the credential to a separate file
and includes it via includeIf.gitdir.
configureGitAuth only ran git config --unset-all http.*.extraheader, which clears the local config but not the included file. The read-only
GITHUB_TOKEN extraheader persisted and took precedence over the app token set in the remote URL, causing git push to fail with 403.
Fix
After the existing --unset-all, also find and remove includeIf.gitdir entries and delete their associated credential config files — matching
what checkout v6's own post-step cleanup does.
Test plan