Skip to content

parseGitHubRemote / parseAzureDevOpsRemote fail on repo names containing dots #1077

Closed

Description

@vejadu

Summary

squad watch fails with Could not detect platform: Could not parse GitHub remote URL: <url> when the origin remote points to a repo whose name contains a . character (e.g. https://github.com/myorg/my.repo.name.git).

Repro

git init
git remote add origin https://github.com/myorg/JADE.xlighthousepipelines.git
npx @bradygaster/squad-cli watch

Output:

Could not detect platform: Could not parse GitHub remote URL: https://github.com/myorg/JADE.xlighthousepipelines.git

Root cause

In packages/squad-sdk/src/platform/detect.ts, the repo capture group is ([^/.]+?) — i.e. one-or-more characters that are not / and not .:

// HTTPS: https://github.com/owner/repo.git
const httpsMatch = url.match(/github\.com\/([^/]+)\/([^/.]+?)(?:\.git)?$/i);

// SSH: git@github.com:owner/repo.git
const sshMatch = url.match(/github\.com:([^/]+)\/([^/.]+?)(?:\.git)?$/i);

For https://github.com/myorg/JADE.xlighthousepipelines.git:

  • owner captures myorg
  • repo group can only match up to (but not including) the first ., so it tries JADE
  • the optional (?:\.git)?$ then needs to match .xlighthousepipelines.git$ — it doesn't
  • [^/.] can't consume the . to extend, so the entire match fails and parseGitHubRemote returns null

The error then bubbles up from createPlatformAdapter in packages/squad-sdk/src/platform/index.ts and becomes the Could not detect platform: ... fatal in packages/squad-cli/src/cli/commands/watch/index.ts.

GitHub allows . in repo names (other than the leading-dot / . / .. special cases), so this is a legitimate parsing miss rather than user error.

Same bug in Azure DevOps parser

parseAzureDevOpsRemote has the same ([^/.]+?) repo capture in all three of its regexes (dev.azure.com HTTPS, ssh.dev.azure.com SSH, legacy *.visualstudio.com), so any ADO repo with a dot in its name will also fail to parse.

Proposed fix

Change the repo capture group from [^/.]+? to [^/]+? in all four regexes. The trailing (?:\.git)?$ plus the non-greedy quantifier still strip a trailing .git correctly while preserving dots inside the repo name.

Cases the fix should pass:

URL owner repo
https://github.com/foo/bar.git foo bar
https://github.com/foo/bar foo bar
https://github.com/foo/bar.baz.git foo bar.baz
git@github.com:foo/bar.baz.qux.git foo bar.baz.qux
https://dev.azure.com/org/proj/_git/repo.with.dots (org=org, project=proj, repo=repo.with.dots)

Happy to send a PR with tests covering these cases.

Activity

  1. vejadu commented on May 4, 2026

    @vejadu
    ContributorAuthor

    Fix proposed in #1078.

  2. added a commit that references this issue on May 12, 2026
    c56e23f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions