coleam00/Archon · error

Cannot parse GitHub URL: ${sourceUrl}

Error message

Cannot parse GitHub URL: ${sourceUrl}

What it means

Error "Cannot parse GitHub URL: ${sourceUrl}" thrown in coleam00/Archon.

Source

Thrown at packages/cli/src/commands/workflow.ts:5078

  return sourceUrl.includes('/tree/');
}

/**
 * Validate that a path component from an external source is safe to use in a filesystem path.
 * Rejects names containing path separators, traversal sequences, or non-portable characters.
 */
function isSafePathComponent(name: string): boolean {
  return name !== '.' && name !== '..' && /^[a-zA-Z0-9._-]+$/.test(name);
}

/** Parse owner/repo and path from a GitHub blob or tree URL. */
function parseGitHubUrl(sourceUrl: string): { owner: string; repo: string; path: string } {
  // https://github.com/owner/repo/blob/ref/path or https://github.com/owner/repo/tree/ref/path
  const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+)\/(blob|tree)\/[^/]+\/(.+)$/.exec(
    sourceUrl
  );
  if (!match) {
    throw new Error(`Cannot parse GitHub URL: ${sourceUrl}`);
  }
  return { owner: match[1], repo: match[2], path: match[4] };
}

interface GitHubContentItem {
  name: string;
  type: 'file' | 'dir';
  download_url: string | null;
  path: string;
}

/** Fetch directory listing from GitHub Contents API at a pinned SHA. */
async function fetchGitHubDirectory(
  owner: string,
  repo: string,
  path: string,
  sha: string
): Promise<GitHubContentItem[]> {

View on GitHub (pinned to 0773b97458)

When it happens

Trigger: Thrown at packages/cli/src/commands/workflow.ts:5078 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/c7e4a671e71cc468. Report an issue: GitHub.