{"record":{"id":"0e0b28d07207add3","repo":"badges/shields","slug":"no-matching-tags-found","errorCode":null,"errorMessage":"no matching tags found","messagePattern":"no matching tags found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/github/github-tag.service.js","lineNumber":115,"sourceCode":"      return latest(tags, { pre: includePrereleases })\n    }\n    return tags[0]\n  }\n\n  async handle({ user, repo }, queryParams) {\n    const sort = queryParams.sort\n    const includePrereleases = queryParams.include_prereleases !== undefined\n    const filter = queryParams.filter\n    const limit = this.constructor.getLimit({ sort, filter })\n\n    const json = await this.fetch({ user, repo, limit })\n    const tags = this.constructor.applyFilter({\n      tags: json.data.repository.refs.edges.map(edge => edge.node.name),\n      filter,\n    })\n    if (tags.length === 0) {\n      const prettyMessage = filter ? 'no matching tags found' : 'no tags found'\n      throw new NotFound({ prettyMessage })\n    }\n    return renderVersionBadge({\n      version: this.constructor.getLatestTag({\n        tags,\n        sort,\n        includePrereleases,\n      }),\n    })\n  }\n}\n\nconst redirects = {\n  GithubTagRedirect: redirector({\n    category: 'version',\n    route: {\n      base: 'github/tag',\n      pattern: ':user/:repo',\n    },","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/github/github-tag.service.js#L97-L133","documentation":"The GitHub tag service lists repository tags via GraphQL, applies an optional `filter` regexp, and throws `NotFound` when the resulting list is empty. The message distinguishes cases: 'no matching tags found' means tags exist but none matched the requested `filter` pattern. It is a filtering result, not a fetch failure.","triggerScenarios":"Requesting a tag badge with a `filter` query param whose regexp matches none of the repository's tag names; tags array is non-empty but every name fails the filter.","commonSituations":"Filter pattern typo (e.g. filter=v[0-9] when tags lack the 'v' prefix); repository only has un-tagged releases; expecting semver tags but repo uses different naming; filter intended for another repo's conventions.","solutions":["Adjust the `filter` regexp to match the repo's actual tag naming scheme","List the repo's tags on GitHub and align the filter with them","Remove the `filter` parameter to use the unfiltered tag list","Tag the repository with names matching the expected pattern"],"exampleFix":"// before\n/badge/tag/user/repo?filter=^v\\d   // repo tags are '1.0.0', '2.0.0' -> no matching tags found\n// after\n/badge/tag/user/repo?filter=^\\d+\\.\\d+\\.\\d+$","handlingStrategy":"validation","validationCode":"const { data } = await fetch(`https://api.github.com/repos/${user}/${repo}/tags`).then(r => r.json())\nconst names = data.map(t => t.name)\nif (filter && !names.some(n => new RegExp(filter).test(n))) {\n  throw new Error(`no tag matches filter '${filter}'; tags: ${names.join(', ')}`)\n}","typeGuard":"null","tryCatchPattern":"try {\n  await fetchTagBadge(user, repo, filter)\n} catch (e) {\n  if (e.message === 'no matching tags found') return 'no tag'\n  throw e\n}","preventionTips":["Test your filter regexp against the repo's actual tag names","Remember 'no matching tags found' means filtering, not absence of tags — try removing `filter` to debug","Keep tag naming conventions consistent (e.g. always v-prefixed)"],"tags":["github","not-found","tags","regex"],"backgroundTag":"empty-response-no-data","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}