Skip to content

Hub install fails for SSH-only GHE users when source uses domain-prefix format #196

@dotned

Description

@dotned

Ran into this setting up an internal hub on GitHub Enterprise where all access is via SSH (no PAT / GH_TOKEN configured).

Setup

  • Hub registered via SSH: skillshare hub add acme@acme.ghe.com:Org/skills.git
  • Skillshare v0.20.7

Problem

Installing a skill from the hub fails when the hub JSON source field uses domain-prefix format:

"source": "acme.ghe.com/Org/repo/skills/my-skill"

expandGitHubShorthand converts this to https://acme.ghe.com/... → HTTPS clone with no credentials → auth failure.

This affects both CLI (skillshare search --hub <label> → select → install) and the web UI.

Code path

The issue is in internal/install/source.goexpandGitHubShorthand (line 212), called from ParseSource which is the shared entry point for both CLI and UI:

// If the first segment contains ".", it's a domain (e.g., gitlab.com/user/repo)
// not a GitHub owner — prepend https:// so gitHTTPSPattern can match it
firstSegment := input[:firstSlash]
if strings.Contains(firstSegment, ".") {
    return "https://" + input
}

Any source with a domain (like acme.ghe.com/Org/repo/path) gets https:// prepended unconditionally. No opportunity to try SSH if HTTPS fails.

Workaround

Using SSH format in the hub JSON source field works:

"source": "acme@acme.ghe.com:Org/repo.git//skills/my-skill"

Install succeeds via SSH agent. Preview still doesn't work though (Contents API path has no SSH fallback).

Impact

Source format Install (CLI) Install (UI) Preview
Domain-prefix
SSH

Thoughts

Either (or both):

  1. Docs — mention in the hub-index guide that SSH-only hosts need SSH format in the source field
  2. Fallback — when HTTPS clone/API gets a 401/403 on a GHE host, try SSH as a graceful fallback (would also fix preview)

Related: #193 (fixed API host resolution in v0.20.6; this covers the remaining auth gap for SSH-only setups)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions