mislav/hub · error

the `--include` pattern did not match any available assets:\

Error message

the `--include` pattern did not match any available assets:\n%s

What it means

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.

Source

Thrown at commands/release.go:420

			isMatch, err := filepath.Match(args.Flag.Value("--include"), asset.Name)
			utils.Check(err)
			if !isMatch {
				continue
			}
		}

		found = true
		ui.Printf("Downloading %s ...\n", asset.Name)
		err := downloadReleaseAsset(asset, gh)
		utils.Check(err)
	}

	if !found && hasPattern {
		names := []string{}
		for _, asset := range release.Assets {
			names = append(names, asset.Name)
		}
		utils.Check(fmt.Errorf("the `--include` pattern did not match any available assets:\n%s", strings.Join(names, "\n")))
	}

	args.NoForward()
}

func downloadReleaseAsset(asset github.ReleaseAsset, gh *github.Client) (err error) {
	assetReader, err := gh.DownloadReleaseAsset(asset.APIURL)
	if err != nil {
		return
	}
	defer assetReader.Close()

	assetFile, err := os.OpenFile(asset.Name, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644)
	if err != nil {
		return
	}
	defer assetFile.Close()

View on GitHub (pinned to 5c547ed804)

Solutions

  1. Compare your pattern with the listed available asset names and correct it (the error message enumerates them).
  2. Verify you targeted the right release/tag (`gh release list` / correct tag flag).
  3. Check the release page to confirm assets were uploaded; if not, upload them with `gh release upload`.
  4. Widen the pattern (e.g. use '*.tar.gz' or drop --include to download all assets).

Example fix

// before
gh release download v1.2.0 --include "App-linux.tar.gz"
// after (asset actually named app-linux.tar.gz)
gh release download v1.2.0 --include "app-linux.tar.gz"
Defensive patterns

Strategy: validation

Validate before calling

assets, _ := gh.ReleaseAssets(tag)
names := assetNames(assets)
matched := matchAny(names, pattern)
if !matched {
    fmt.Println("no asset matches", pattern, "available:", strings.Join(names, ", "))
    os.Exit(1)
}

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Related errors


AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01). Data as JSON: /api/errors/e4fee0fa8babdbf4. Report an issue: GitHub.