fix: configure git credentials before installing plugin marketplaces#1247
Open
anishesg wants to merge 1 commit intoanthropics:mainfrom
Open
fix: configure git credentials before installing plugin marketplaces#1247anishesg wants to merge 1 commit intoanthropics:mainfrom
anishesg wants to merge 1 commit intoanthropics:mainfrom
Conversation
When `plugin_marketplaces` references a private or internal GitHub repository, the `plugin marketplace add` subprocess spawned by `installPlugins()` fails to authenticate with git because no credential helper is configured at that point. The `configureGitAuth()` function in `src/github/operations/git-config.ts` correctly sets up credentials, but it is only called in execution paths—never in `base-action/src/index.ts`. Signed-off-by: anish k <ak8686@princeton.edu>
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.
When
plugin_marketplacesreferences a private or internal GitHub repository, theplugin marketplace addsubprocess spawned byinstallPlugins()fails to authenticate with git because no credential helper is configured at that point. TheconfigureGitAuth()function insrc/github/operations/git-config.tscorrectly sets up credentials, but it is only called in execution paths—never inbase-action/src/index.ts.This adds a
configureGitCredentials()helper inbase-action/src/index.tsthat sets a global git credential helper using theGITHUB_TOKEN(always available in GitHub Actions environments) beforeinstallPlugins()is invoked. The credential helper readsGH_TOKENfrom the environment at authentication time, so the token is never embedded in.git/config. This mirrors the approach already used in theALLOWED_NON_WRITE_USERSbranch ofconfigureGitAuth().Changes:
base-action/src/index.ts: addedconfigureGitCredentials()and call it with the availableGITHUB_TOKEN/GH_TOKENbeforeinstallPlugins()runs.Fixes #850