{"record":{"id":"6c6fa736e2f22be0","repo":"badges/shields","slug":"no-matching-releases-found","errorCode":null,"errorMessage":"no matching releases found","messagePattern":"no matching releases found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/github/github-common-release.js","lineNumber":150,"sourceCode":"\n  if (!includePrereleases && sort === 'date' && !filter) {\n    const releaseInfo = await fetchLatestGitHubRelease(serviceInstance, {\n      user,\n      repo,\n    })\n    return releaseInfo\n  }\n\n  const releases = applyFilter({\n    releases: await fetchReleases(serviceInstance, { user, repo }),\n    filter,\n    displayName,\n  })\n  if (releases.length === 0) {\n    const prettyMessage = filter\n      ? 'no matching releases found'\n      : 'no releases found'\n    throw new NotFound({ prettyMessage })\n  }\n  const latestRelease = getLatestRelease({ releases, sort, includePrereleases })\n  return latestRelease\n}\n\nexport { fetchLatestRelease, queryParamSchema, openApiQueryParams }\n\n// currently only used for tests\nexport const _getLatestRelease = getLatestRelease\nexport const _applyFilter = applyFilter\n","sourceCodeStart":132,"sourceCodeEnd":161,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/github/github-common-release.js#L132-L161","documentation":"fetchLatestRelease() fetches a repository's releases and throws NotFound when the list is empty. If a `filter` query param was supplied the message is 'no matching releases found', distinguishing 'the repo has releases but none match your filter' from 'no releases found'. It is a 404-style result meaning your filter criteria excluded every release.","triggerScenarios":"Calling a release-based service (e.g. github/release, downloads, latest release) with query params like `include_prereleases=false` combined with a repo whose only releases are prereleases, or a filter/label that matches no release tags.","commonSituations":"Repo publishes only prereleases while the badge defaults to excluding them; filtering by a release name/tag pattern that no longer exists after renaming; repos that use tags-only (no formal releases).","solutions":["Relax or remove the filter query param so existing releases match.","Add `include_prereleases=1` if the repo only ships prereleases.","Confirm the repo actually has GitHub Releases (not just tags) at the Releases page; create one if needed."],"exampleFix":"// before\n/service/github/release/user/repo.json?filter=v1\n// after\n/service/github/release/user/repo.json?include_prereleases=1","handlingStrategy":"try-catch","validationCode":"// check any release matches before requesting\nconst rels = await fetch('https://api.github.com/repos/OWNER/REPO/releases').then(r => r.json());\nif (!rels.some(r => !r.prerelease && (!filter || r.tag_name.includes(filter)))) throw new Error('no matching releases');","typeGuard":"function hasMatchingReleases(releases, filter) {\n  return Array.isArray(releases) && releases.some(r => r != null && typeof r.tag_name === 'string' && (!filter || r.tag_name.includes(filter)));\n}","tryCatchPattern":"try {\n  const release = await getLatestRelease({ user, repo, filter });\n} catch (e) {\n  if (e.prettyMessage === 'no matching releases found') {\n    // retry without filter or show 'no release' badge state\n  } else throw e;\n}","preventionTips":["Confirm the repo publishes formal GitHub Releases, not just tags.","Set include_prereleases=1 for prerelease-only repos.","Keep filter patterns in sync with your tagging scheme."],"tags":["github","not-found","releases","filter-no-match"],"backgroundTag":"no-releases-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}