Skip to content

Support version pinning for plugin_marketplaces #1229

@ncaq

Description

@ncaq

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:

{
  "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:

// 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 <ref> 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:

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:

marketplace_refs: |
  konoka=v5.0.0

Use case

# 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"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions