Skip to content

[BUG] apm marketplace build fails for GitHub Enterprise Server repositories #1008

@kkadete

Description

@kkadete

Describe the bug

Running apm marketplace build against a marketplace whose packages are hosted on a GitHub Enterprise Server (GHES) instance always fails with a Git authentication error, even when GITHUB_HOST and a valid GHE token are set in the environment.

The error message reveals that APM is contacting github.com instead of the configured GHE host, so authentication always fails regardless of the credentials provided.

To Reproduce

Steps to reproduce the behavior:

  1. Author a marketplace.yml with packages sourced from a GHES instance (e.g. corp.ghe.com)
  2. Set GITHUB_HOST=corp.ghe.com in the environment
  3. Set GITHUB_TOKEN to a valid personal access token for that GHE instance
  4. Run apm marketplace build --dry-run --verbose
  5. See error:
GitLsRemoteError: Git authentication failed during ls-remote for 'org/repo'.
  Remote: https://github.com/org/repo.git
  Hint: Check that GITHUB_TOKEN is set and has read access to the repository.

Note the remote URL in the error — it points to github.com instead of the GHE host, confirming GITHUB_HOST is not being respected.

Expected behavior

Setting GITHUB_HOST=corp.ghe.com should cause apm marketplace build to resolve package refs against that host, consistent with how apm install already supports the host/owner/repo syntax for GHE repos.

Environment:

  • OS: Windows (Cygwin)
  • APM Version: 0.10.0
  • VSCode Version: latest

Logs

$ GITHUB_HOST=corp.ghe.com apm marketplace build --dry-run --verbose
...
GitLsRemoteError: Git authentication failed during ls-remote for 'org/repo'.
  Remote: https://github.com/org/repo.git
  Hint: Check that GITHUB_TOKEN is set and has 'repo' scope...

Additional context

This affects the marketplace-authoring experimental feature. The apm install command supports GHE via host/owner/repo notation, so there is precedent for GHE support in APM. The marketplace build command appears to not yet have equivalent support.

Metadata

Metadata

Labels

area/enterpriseAir-gapped/GHE configurability, registry proxy, rulesets, adoption playbook.area/marketplacemarketplace.json schema, federation, authoring suite, source parity.priority/highShips in current or next milestonestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.type/featureNew capability, new flag, new primitive.

Type

No type

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions