anthropics / anthropics/claude-code-action
Support version pinning for plugin_marketplaces
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.1k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
## Summary
I'd like the `plugin_marketplaces` input parameter to support pinning a specific version of the marketplace repository.
## Motivation
Currently, `plugin_marketplaces` only accepts URLs in the form `https://github.com/user/marketplace.git` and always clones the HEAD of the default branch.
This means that whenever the marketplace repository is updated, compatibility with downstream repositories using the action can break. Just as GitHub Actions itself supports version pinning with `uses: actions/checkout@v6`, plugin marketplaces should also support version pinning.
Claude Code already supports version pinning via the `ref` field in `extraKnownMarketplaces` in `settings.json`:
```json
{
"extraKnownMarketplaces": {
"konoka": {
"source": {
"source": "github",
"repo": "ncaq/konoka",
"ref": "v5.0.0"
}
}
}
}
```
Having equivalent functionality in claude-code-action's `plugin_marketplaces` would enable consistent version management between the CLI and the Action.
## Proposal
### Option 1: Fragment URL support (lightweight approach)
Accept fragment-style URLs like `https://github.com/user/marketplace.git#v5.0.0`.
Currently, `MARKETPLACE_URL_REGEX` in `base-action/src/install-plugins.ts` requires the URL to end with `.git`, so any content after `.git` causes a validation error:
```typescript
// Current
const MARKETPLACE_URL_REGEX = /^https:\/\/[a-zA-Z0-9\-._~:/?#[\]@!$&'()*+,;=%]+\.git$/;
```
The fix would be to allow an optional fragment part and parse it to pass to `git clone --branch ` or similar.
### Option 2: Structured ref support aligned with settings.json (comprehensive approach)
Support structured marketplace definitions, similar to how `extraKnownMarketplaces` works in settings.json. For example:
```yaml
plugin_marketplaces: |
- url: https://github.com/user/marketplace.git
ref: v5.0.0
- url: https://github.com/other/marketplace.git
ref: v2.1.0
```
Or a simpler key-value style:
```yaml
marketplace_refs: |
konoka=v5.0.0
```
## Use case
```yaml
# Option 1
- uses: anthropics/claude-code-action@v1
with:
plugin_marketplaces: "https://github.com/user/marketplace.git#v5.0.0"
plugins: "my-plugin@marketplace"
# Option 2
- uses: anthropics/claude-code-action@v1
with:
plugin_marketplaces: |
- url: https://github.com/user/marketplace.git
ref: v5.0.0
plugins: "my-plugin@marketplace"
```
Contributor guide
Research direction
Start in base-action/src/install-plugins.ts, especially MARKETPLACE_URL_REGEX and the existing plugin_marketplaces parsing and clone flow. Compare the proposed fragment and structured-ref approaches, then trace how a selected ref would reach git clone. Done means a marketplace can be pinned without breaking existing URL input and the chosen interface is documented and validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100