badges/shields · error · NotFound

no releases found

Error message

no releases found

What it means

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.

Source

Thrown at services/gitea/gitea-release.service.js:99

        ],
      },
    },
  }

  static defaultBadgeData = { label: 'release' }

  async fetch({ user, repo, baseUrl }) {
    // https://gitea.com/api/swagger#/repository/repoGetRelease
    return super.fetch({
      schema,
      url: `${baseUrl}/api/v1/repos/${user}/${repo}/releases`,
      httpErrors: httpErrorsFor(),
    })
  }

  static transform({ releases, isSemver, includePrereleases, displayName }) {
    if (releases.length === 0) {
      throw new NotFound({ prettyMessage: 'no releases found' })
    }

    const displayKey = displayName === 'tag' ? 'tag_name' : 'name'

    if (isSemver) {
      return latest(
        releases.map(t => t[displayKey]),
        { pre: includePrereleases },
      )
    }

    if (!includePrereleases) {
      const stableReleases = releases.filter(release => !release.prerelease)
      if (stableReleases.length > 0) {
        return stableReleases[0][displayKey]
      }
    }

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Create a release in the Gitea repository UI (releases, not just tags)
  2. Verify owner/repo in the badge URL match the repo that actually has releases
  3. Check the Gitea API /repos/{owner}/{repo}/releases returns a non-empty array with the configured token
  4. If a tag-only workflow is intentional, use a tag-based badge instead of a release badge

Example fix

// before
GET /api/v1/repos/myorg/myrepo/releases  → []
// after — publish a release, or target another repo
GET /api/v1/repos/myorg/myrepo/releases  → [{ tag_name: 'v1.0.0', ... }]
Defensive patterns

Strategy: validation

Validate before calling

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');

Type guard

const hasReleases = (v) => Array.isArray(v) && v.length > 0;

Try / catch

try { return await giteaReleaseBadge({ host, owner, repo }); } catch (e) { if (String(e.message).includes('no releases found')) { return renderBadge('no releases'); } throw e; }

Prevention

When it happens

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

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

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/49caf077147effa8. Report an issue: GitHub.