Skip to content

fix: configure git credentials before installing plugin marketplaces#1247

Open
anishesg wants to merge 1 commit intoanthropics:mainfrom
anishesg:fix/ph-issue-850
Open

fix: configure git credentials before installing plugin marketplaces#1247
anishesg wants to merge 1 commit intoanthropics:mainfrom
anishesg:fix/ph-issue-850

Conversation

@anishesg
Copy link
Copy Markdown

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.

This adds a configureGitCredentials() helper in base-action/src/index.ts that sets a global git credential helper using the GITHUB_TOKEN (always available in GitHub Actions environments) before installPlugins() is invoked. The credential helper reads GH_TOKEN from the environment at authentication time, so the token is never embedded in .git/config. This mirrors the approach already used in the ALLOWED_NON_WRITE_USERS branch of configureGitAuth().

Changes:

  • base-action/src/index.ts: added configureGitCredentials() and call it with the available GITHUB_TOKEN/GH_TOKEN before installPlugins() runs.

Fixes #850

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Marketplace cloning fails with 'repository not found' for private/internal repos - git authentication not configured

1 participant