Problem
skillshare install fails when the source is a GitHub Enterprise (GHE) instance using Data Residency, because these instances require a custom SSH username rather than the standard git@.
GHE Data Residency instances use the subdomain as the SSH username. For example, an instance at acme.ghe.com requires SSH connections as acme@acme.ghe.com — the server rejects git@acme.ghe.com entirely.
Reproduction (extrapolated, not tested against the fix)
# This is how the remote looks in .git/config for a GHE DR instance:
# acme@acme.ghe.com:MyOrg/my-skills.git
# Attempting to install via SSH fails:
skillshare install git@acme.ghe.com:MyOrg/my-skills --track
# ✗ failed to clone repository: Could not read from remote repository.
# Using the actual username format isn't recognised:
skillshare install acme@acme.ghe.com:MyOrg/my-skills --track
# ✗ invalid source / fails to parse
Root Cause
In internal/install/source.go:
-
Line 56 — the SSH regex only matches the literal git@ prefix:
var gitSSHPattern = regexp.MustCompile(`^git@([^:]+):([^/]+)/(.+?)(?:\.git)?(?://(.+))?$`)
-
Line 182 — the prefix check only recognises git@:
strings.HasPrefix(input, "git@") ||
-
Line 312 — the clone URL is reconstructed with hardcoded git@:
source.CloneURL = fmt.Sprintf("git@%s:%s/%s.git", host, owner, repo)
Suggested Fix
Generalise the SSH pattern to accept any username, and preserve it in the clone URL:
// Accept any user@host: format (captures username separately)
var gitSSHPattern = regexp.MustCompile(`^([^@]+)@([^:]+):([^/]+)/(.+?)(?:\.git)?(?://(.+))?$`)
And in parseGitSSH, preserve the original username:
source.CloneURL = fmt.Sprintf("%s@%s:%s/%s.git", user, host, owner, repo)
The prefix check (line 182) should match any <something>@<something>: pattern rather than just git@.
Why This Matters
GitHub Enterprise with Data Residency is GitHub's model for regulated industries and data sovereignty. These instances are becoming more common. The SSH username is assigned by the platform (matching the subdomain) and cannot be changed to git@.
Backwards Compatibility
This change is fully backwards-compatible — git@github.com:user/repo still matches the generalised pattern. It simply stops rejecting other valid SSH usernames.
Problem
skillshare installfails when the source is a GitHub Enterprise (GHE) instance using Data Residency, because these instances require a custom SSH username rather than the standardgit@.GHE Data Residency instances use the subdomain as the SSH username. For example, an instance at
acme.ghe.comrequires SSH connections asacme@acme.ghe.com— the server rejectsgit@acme.ghe.comentirely.Reproduction (extrapolated, not tested against the fix)
Root Cause
In
internal/install/source.go:Line 56 — the SSH regex only matches the literal
git@prefix:Line 182 — the prefix check only recognises
git@:Line 312 — the clone URL is reconstructed with hardcoded
git@:Suggested Fix
Generalise the SSH pattern to accept any username, and preserve it in the clone URL:
And in
parseGitSSH, preserve the original username:The prefix check (line 182) should match any
<something>@<something>:pattern rather than justgit@.Why This Matters
GitHub Enterprise with Data Residency is GitHub's model for regulated industries and data sovereignty. These instances are becoming more common. The SSH username is assigned by the platform (matching the subdomain) and cannot be changed to
git@.Backwards Compatibility
This change is fully backwards-compatible —
git@github.com:user/repostill matches the generalised pattern. It simply stops rejecting other valid SSH usernames.