{"record":{"id":"e4fee0fa8babdbf4","repo":"mislav/hub","slug":"the-include-pattern-did-not-match-any-availabl","errorCode":null,"errorMessage":"the `--include` pattern did not match any available assets:\\n%s","messagePattern":"the `--include` pattern did not match any available assets:\\\\n(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"commands/release.go","lineNumber":420,"sourceCode":"\t\t\tisMatch, err := filepath.Match(args.Flag.Value(\"--include\"), asset.Name)\n\t\t\tutils.Check(err)\n\t\t\tif !isMatch {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tfound = true\n\t\tui.Printf(\"Downloading %s ...\\n\", asset.Name)\n\t\terr := downloadReleaseAsset(asset, gh)\n\t\tutils.Check(err)\n\t}\n\n\tif !found && hasPattern {\n\t\tnames := []string{}\n\t\tfor _, asset := range release.Assets {\n\t\t\tnames = append(names, asset.Name)\n\t\t}\n\t\tutils.Check(fmt.Errorf(\"the `--include` pattern did not match any available assets:\\n%s\", strings.Join(names, \"\\n\")))\n\t}\n\n\targs.NoForward()\n}\n\nfunc downloadReleaseAsset(asset github.ReleaseAsset, gh *github.Client) (err error) {\n\tassetReader, err := gh.DownloadReleaseAsset(asset.APIURL)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer assetReader.Close()\n\n\tassetFile, err := os.OpenFile(asset.Name, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer assetFile.Close()\n","sourceCodeStart":402,"sourceCodeEnd":438,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/commands/release.go#L402-L438","documentation":"When downloading a release, `--include` filters which assets are saved. After iterating the release's assets, if none matched the pattern (found == false) and a pattern was supplied, downloadRelease aborts, listing the asset names that were available for comparison.","triggerScenarios":"`gh release download --include <pattern>` where no asset.Name in release.Assets matched the pattern — the release simply contains no file with that name/glob.","commonSituations":"Wrong tag or repo queried so the expected asset isn't in this release; pattern casing mismatch (asset is 'app-linux.tar.gz' but pattern was 'App-*'); assets not yet uploaded or named differently in a new release version.","solutions":["Compare your pattern with the listed available asset names and correct it (the error message enumerates them).","Verify you targeted the right release/tag (`gh release list` / correct tag flag).","Check the release page to confirm assets were uploaded; if not, upload them with `gh release upload`.","Widen the pattern (e.g. use '*.tar.gz' or drop --include to download all assets)."],"exampleFix":"// before\ngh release download v1.2.0 --include \"App-linux.tar.gz\"\n// after (asset actually named app-linux.tar.gz)\ngh release download v1.2.0 --include \"app-linux.tar.gz\"","handlingStrategy":"validation","validationCode":"assets, _ := gh.ReleaseAssets(tag)\nnames := assetNames(assets)\nmatched := matchAny(names, pattern)\nif !matched {\n    fmt.Println(\"no asset matches\", pattern, \"available:\", strings.Join(names, \", \"))\n    os.Exit(1)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List assets with `gh release view <tag>` before downloading.","Match asset name casing exactly.","Confirm the correct tag and repo are targeted.","Verify assets were uploaded to the release."],"tags":["release","assets","pattern-matching","cli"],"backgroundTag":"no-matching-asset","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}