{"record":{"id":"e69b162a137f926a","repo":"jdx/mise","slug":"brew-cask-unsupported-tap-url-for-name-only","errorCode":null,"errorMessage":"brew-cask: unsupported tap URL for '{name}'; only GitHub tap URLs can be fetched directly","messagePattern":"brew-cask: unsupported tap URL for '(.+?)'; only GitHub tap URLs can be fetched directly","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/brew/cask.rs","lineNumber":913,"sourceCode":"    }\n}\n\nasync fn fetch_cask(req: &PackageRequest) -> Result<Cask> {\n    let name = &req.name;\n    let (requested_token, official_api) = match split_tap_name(name) {\n        Some((\"homebrew\", \"cask\", token)) => (token, true),\n        Some((_, _, token)) => (token, false),\n        None => (name.as_str(), true),\n    };\n    validate_cask_path_component(\"requested token\", requested_token)?;\n    let (url, raw_base) = match split_tap_name(name) {\n        Some((\"homebrew\", \"cask\", token)) => (\n            format!(\"{API_BASE}/cask/{token}.json\"),\n            Some(HOMEBREW_CASK_RAW.to_string()),\n        ),\n        Some((owner, tap, token)) => {\n            let Some(base) = super::api::tap_raw_base(owner, tap, req.tap_url.as_deref()) else {\n                bail!(\n                    \"brew-cask: unsupported tap URL for '{name}'; only GitHub tap URLs can be fetched directly\"\n                );\n            };\n            (\n                format!(\"{base}/api/cask/{token}.json\"),\n                Some(base.trim_end_matches(\"/HEAD\").to_string()),\n            )\n        }\n        None => (\n            format!(\"{API_BASE}/cask/{name}.json\"),\n            Some(HOMEBREW_CASK_RAW.to_string()),\n        ),\n    };\n    let mut cask = HTTP_FETCH\n        .json_cached::<Cask, _>(url)\n        .await\n        .wrap_err_with(|| {\n            format!(","sourceCodeStart":895,"sourceCodeEnd":931,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/brew/cask.rs#L895-L931","documentation":"fetch_cask (src/system/packages/brew/cask.rs:913) resolves a tapped cask request (owner/tap/token) to the tap's raw GitHub metadata URL. super::api::tap_raw_base only builds a base when the tap URL configured in [bootstrap.brew.taps] passes github_raw_base (api.rs:231) — a plain https://github.com/owner/repo shape with no extra path segments; any other URL yields None and mise refuses, because only GitHub raw URLs are fetched directly.","triggerScenarios":"Requesting owner/tap/cask-name while the [bootstrap.brew.taps] entry for that tap is a GitLab/Gitea/self-hosted URL, an SSH URL (git@github.com:owner/repo.git), or a GitHub URL with subpaths like /tree/main — every case github_raw_base rejects.","commonSituations":"GitHub Enterprise or other mirrored hosts recorded as tap URLs; users pasting clone or page URLs including subdirectories; SSH URLs copied from the GitHub Code dropdown.","solutions":["Set the tap to a plain GitHub web URL in [bootstrap.brew.taps], e.g. owner/tap = https://github.com/owner/homebrew-tap","Convert SSH URLs to https and strip .git suffixes and subpaths so only owner/repo remains","Taps outside GitHub cannot be served by this direct-fetch design — install such casks via the Homebrew CLI instead"],"exampleFix":"# before (mise.toml)\n[bootstrap.brew.taps]\n\"acme/casks\" = \"git@github.com:acme/homebrew-casks.git\"\n\n# after\n[bootstrap.brew.taps]\n\"acme/casks\" = \"https://github.com/acme/homebrew-casks\"","handlingStrategy":"validation","validationCode":"fn tap_url_is_github(url: &str) -> bool {\n    let rest = url.trim_end_matches(\".git\").trim_end_matches('/');\n    match rest.strip_prefix(\"https://github.com/\") {\n        Some(r) => !r.is_empty() && r.split('/').count() == 2,\n        None => false,\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Accept only plain https://github.com/owner/repo URLs in tap configuration","Normalize pasted URLs (drop /tree/main, .git, SSH forms) at config-write time","Track that mise's brew integration fetches GitHub raw directly — non-GitHub taps need the brew CLI"],"tags":["brew-cask","tap","github","url-validation"],"backgroundTag":"unsupported-package-repository-url","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}