{"record":{"id":"49caf077147effa8","repo":"badges/shields","slug":"no-releases-found","errorCode":null,"errorMessage":"no releases found","messagePattern":"no releases found","errorType":"exception","errorClass":"NotFound","httpStatus":404,"severity":"error","filePath":"services/gitea/gitea-release.service.js","lineNumber":99,"sourceCode":"        ],\n      },\n    },\n  }\n\n  static defaultBadgeData = { label: 'release' }\n\n  async fetch({ user, repo, baseUrl }) {\n    // https://gitea.com/api/swagger#/repository/repoGetRelease\n    return super.fetch({\n      schema,\n      url: `${baseUrl}/api/v1/repos/${user}/${repo}/releases`,\n      httpErrors: httpErrorsFor(),\n    })\n  }\n\n  static transform({ releases, isSemver, includePrereleases, displayName }) {\n    if (releases.length === 0) {\n      throw new NotFound({ prettyMessage: 'no releases found' })\n    }\n\n    const displayKey = displayName === 'tag' ? 'tag_name' : 'name'\n\n    if (isSemver) {\n      return latest(\n        releases.map(t => t[displayKey]),\n        { pre: includePrereleases },\n      )\n    }\n\n    if (!includePrereleases) {\n      const stableReleases = releases.filter(release => !release.prerelease)\n      if (stableReleases.length > 0) {\n        return stableReleases[0][displayKey]\n      }\n    }\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/badges/shields/blob/766fd8bc89a90b8534dc573ab72dec30215ab1ec/services/gitea/gitea-release.service.js#L81-L117","documentation":"Thrown in GiteaReleaseService.transform when the Gitea API reports zero releases for the repository. With an empty releases array there is no latest release to report, so NotFound 'no releases found' is thrown.","triggerScenarios":"Requesting a release/version badge for a Gitea repo that has no releases published (only commits/tags without a release object), or where the API path/owner/repo combination resolves to a repo with releases.length === 0.","commonSituations":"Pointing the badge at a repository that only uses git tags without creating Gitea releases; private repos where the token can auth but sees a mirror with no releases; owner/repo typos resolving to a different, release-less repo.","solutions":["Create a release in the Gitea repository UI (releases, not just tags)","Verify owner/repo in the badge URL match the repo that actually has releases","Check the Gitea API /repos/{owner}/{repo}/releases returns a non-empty array with the configured token","If a tag-only workflow is intentional, use a tag-based badge instead of a release badge"],"exampleFix":"// before\nGET /api/v1/repos/myorg/myrepo/releases  → []\n// after — publish a release, or target another repo\nGET /api/v1/repos/myorg/myrepo/releases  → [{ tag_name: 'v1.0.0', ... }]","handlingStrategy":"validation","validationCode":"const releases = await fetch(`https://<gitea-host>/api/v1/repos/${owner}/${repo}/releases`, { headers: { Authorization: `token ${t}` } }).then(r => r.json());if (!Array.isArray(releases) || releases.length === 0) console.warn('repo has no releases');","typeGuard":"const hasReleases = (v) => Array.isArray(v) && v.length > 0;","tryCatchPattern":"try { return await giteaReleaseBadge({ host, owner, repo }); } catch (e) { if (String(e.message).includes('no releases found')) { return renderBadge('no releases'); } throw e; }","preventionTips":["Create Gitea releases (not just tags) before adding release badges","Double-check owner/repo in the badge URL","Use a tag badge instead when the project tags without publishing releases"],"tags":["gitea","not-found","releases"],"backgroundTag":"resource-not-found","analyzedSha":"766fd8bc89a90b8534dc573ab72dec30215ab1ec","analyzedAt":"2026-08-30T01:40:27.499Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}