badges/shields · info · NotFound

no releases found

Error message

no releases found

What it means

The GitLab release service throws this NotFound when the releases list returned by the GitLab API is empty. With no release objects available it cannot compute the latest version or tag, so it emits a 'no releases found' badge.

Source

Thrown at services/gitlab/gitlab-release.service.js:98

  static defaultBadgeData = { label: 'release' }

  async fetch({ project, baseUrl, isSemver, orderBy }) {
    // https://docs.gitlab.com/ee/api/releases/
    return this.fetchPaginatedArrayData({
      schema,
      url: `${baseUrl}/api/v4/projects/${encodeURIComponent(project)}/releases`,
      httpErrors: httpErrorsFor('project not found'),
      options: {
        searchParams: { order_by: orderBy },
      },
      firstPageOnly: !isSemver,
    })
  }

  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 releases[0][displayKey]
    }

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

  async handle(
    { project },
    {
      gitlab_url: baseUrl = 'https://gitlab.com',

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Create a GitLab Release for the project (Releases > New release or glab release create)
  2. Create a tag with release notes so GitLab generates a release entry
  3. Relax the query: include prereleases or allow non-semver releases if applicable
  4. Remove the release badge until a release exists
Defensive patterns

Strategy: validation

Validate before calling

const releases = await (await fetch(`https://gitlab.com/api/v4/projects/${encodeURIComponent(project)}/releases`)).json()
if (!Array.isArray(releases) || releases.length === 0) console.warn('No GitLab releases published')

Type guard

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

Try / catch

try {
  const version = GitlabRelease.transform({ releases, isSemver, includePrereleases, displayName })
} catch (e) {
  if (e.prettyMessage === 'no releases found') {
    // render 'v0.0.0' or hide badge
  } else throw e
}

Prevention

When it happens

Trigger: Querying the release badge for a project that has never created a GitLab Release (via Releases UI, release CLI, or tag with release notes); or filtering isSemver=true and includePrereleases=false leaving zero matching releases.

Common situations: New projects that only push tags but never publish Releases; repos where all releases are marked pre-release and prereleases are excluded; badge added before the first release was cut.

Related errors


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