Hub install fails for SSH-only GHE users when source uses domain-prefix format
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 [email protected]: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.go — expandGitHubShorthand (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": "[email protected]: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):
- Docs — mention in the hub-index guide that SSH-only hosts need SSH format in the source field
- 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)
Fixed in v0.20.8.
SSH hubs now rewrite same-host GitHub/GHE domain-prefixed entries to inherit the hub SSH identity, so acme.ghe.com/Org/repo/skills/my-skill from an SSH hub installs over SSH instead of HTTPS. SSH GitHub/GHE previews also fall back to clone when the Contents API is unavailable.
Covered by unit/integration tests. I did not validate against a live private GHE tenant, so please let me know if the issue still reproduces after upgrading. Thanks!
Confirmed working on v0.20.9.
Tested with our GHE hub registered via SSH and domain-prefix sources in the hub index:
"source": "ghe.example.com/Org/repo/skills/my-skill"
Results:
- ✅ CLI:
skillshare search --hub→ domain-prefix sources rewritten to SSH → install succeeds - ✅ Web UI: hub search resolves domain-prefix sources to SSH → install succeeds
- ✅ Mixed hub (public GitHub shorthand + GHE domain-prefix) works correctly — only same-host entries are rewritten
- ✅ Preview falls back to clone as expected
The core fix works. Thanks!
Noted a couple of minor UI inconsistencies during testing (display formatting, not functional). Will raise separately.