{"record":{"id":"0cd2b2dd784c6639","repo":"zed-industries/zed","slug":"paste-a-github-md-url","errorCode":null,"errorMessage":"Paste a GitHub .md URL","messagePattern":"Paste a GitHub \\.md URL","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/settings_ui/src/pages/skill_creator.rs","lineNumber":1089,"sourceCode":"    if url.scheme() != \"https\" {\n        anyhow::bail!(\"GitHub skill URLs must use https://\");\n    }\n\n    let host = url\n        .host_str()\n        .ok_or_else(|| anyhow!(\"Enter a valid GitHub URL\"))?;\n    let path_segments = url\n        .path_segments()\n        .ok_or_else(|| anyhow!(\"Enter a valid GitHub URL\"))?\n        .collect::<Vec<_>>();\n\n    match host {\n        \"github.com\" => github_blob_raw_url(&path_segments),\n        \"raw.githubusercontent.com\" => {\n            ensure_markdown_path(&path_segments)?;\n            Ok(url.into())\n        }\n        _ => anyhow::bail!(\"Paste a GitHub .md URL\"),\n    }\n}\n\nfn github_blob_raw_url(path_segments: &[&str]) -> Result<String> {\n    let [owner, repo, kind, reference, file_path @ ..] = path_segments else {\n        anyhow::bail!(\"Paste a GitHub blob URL that points to a .md file\");\n    };\n\n    if *kind != \"blob\" {\n        anyhow::bail!(\"Paste a GitHub blob URL that points to a .md file\");\n    }\n\n    ensure_markdown_path(file_path)?;\n    Ok(format!(\n        \"https://raw.githubusercontent.com/{owner}/{repo}/{reference}/{}\",\n        file_path.join(\"/\")\n    ))\n}","sourceCodeStart":1071,"sourceCodeEnd":1107,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/settings_ui/src/pages/skill_creator.rs#L1071-L1107","documentation":"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.","triggerScenarios":"Thrown at crates/settings_ui/src/pages/skill_creator.rs:1089 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Paste a github.com blob URL or raw.githubusercontent.com URL ending in .md","Copy the URL directly from the GitHub file page"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}