zed-industries/zed · error

Paste a GitHub .md URL

Error message

Paste a GitHub .md URL

What it means

Guard in github_raw_url: the URL host is neither github.com nor raw.githubusercontent.com (or the path shape is wrong), so the input is not a supported GitHub skill URL. It is an input-validation sentinel prompting the user for the right kind of link.

Source

Thrown at crates/settings_ui/src/pages/skill_creator.rs:1089

    if url.scheme() != "https" {
        anyhow::bail!("GitHub skill URLs must use https://");
    }

    let host = url
        .host_str()
        .ok_or_else(|| anyhow!("Enter a valid GitHub URL"))?;
    let path_segments = url
        .path_segments()
        .ok_or_else(|| anyhow!("Enter a valid GitHub URL"))?
        .collect::<Vec<_>>();

    match host {
        "github.com" => github_blob_raw_url(&path_segments),
        "raw.githubusercontent.com" => {
            ensure_markdown_path(&path_segments)?;
            Ok(url.into())
        }
        _ => anyhow::bail!("Paste a GitHub .md URL"),
    }
}

fn github_blob_raw_url(path_segments: &[&str]) -> Result<String> {
    let [owner, repo, kind, reference, file_path @ ..] = path_segments else {
        anyhow::bail!("Paste a GitHub blob URL that points to a .md file");
    };

    if *kind != "blob" {
        anyhow::bail!("Paste a GitHub blob URL that points to a .md file");
    }

    ensure_markdown_path(file_path)?;
    Ok(format!(
        "https://raw.githubusercontent.com/{owner}/{repo}/{reference}/{}",
        file_path.join("/")
    ))
}

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Paste a github.com blob URL or raw.githubusercontent.com URL ending in .md
  2. Copy the URL directly from the GitHub file page
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/settings_ui/src/pages/skill_creator.rs:1089 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/0cd2b2dd784c6639. Report an issue: GitHub.