badges/shields · info · NotFound
no tags found
Error message
no tags found
What it means
The GitLab tag service throws this NotFound when the repository has no tags at all. Since sorting (e.g. by date, date+semver) requires at least one tag, an empty list produces a 'no tags found' badge.
Source
Thrown at services/gitlab/gitlab-tag.service.js:81
async fetch({ project, baseUrl }) {
// https://docs.gitlab.com/ee/api/tags.html
// N.B. the documentation has contradictory information about default sort order.
// As of 2020-10-11 the default is by date, but we add the `order_by` query param
// explicitly in case that changes upstream.
return super.fetch({
schema,
url: `${baseUrl}/api/v4/projects/${encodeURIComponent(
project,
)}/repository/tags`,
options: { searchParams: { order_by: 'updated' } },
httpErrors: httpErrorsFor('project not found'),
})
}
static transform({ tags, sort, includePrereleases }) {
if (tags.length === 0) {
throw new NotFound({ prettyMessage: 'no tags found' })
}
if (sort === 'date') {
return tags[0].name
}
return latest(
tags.map(t => t.name),
{ pre: includePrereleases },
)
}
async handle(
{ project },
{
gitlab_url: baseUrl = 'https://gitlab.com',
include_prereleases: pre,
sort,View on GitHub (pinned to 766fd8bc89)
Solutions
- Create and push a tag (git tag v1.0.0 && git push origin v1.0.0)
- Verify the project path in the badge URL refers to the correct repository
- If tags are intentionally absent, remove the tag/version badge
Defensive patterns
Strategy: validation
Validate before calling
const tags = await (await fetch(`https://gitlab.com/api/v4/projects/${encodeURIComponent(project)}/repository/tags`)).json()
if (!Array.isArray(tags) || tags.length === 0) console.warn('Repository has no tags') Type guard
const hasTags = (t) => Array.isArray(t) && t.length > 0
Try / catch
try {
const value = GitlabTag.transform({ tags, sort, includePrereleases })
} catch (e) {
if (e.prettyMessage === 'no tags found') {
// show 'untagged' or omit badge
} else throw e
} Prevention
- Tag releases (git push --tags) so the badge has data
- Double-check the project path in the badge URL
- Skip tag badges for repos that intentionally do not tag
When it happens
Trigger: Requesting the GitLab tag badge for a repository where the maintainers never ran git push --tags or created any tag; or the project uses releases-only versioning without tags.
Common situations: Brand-new repositories; projects that version only via package metadata and never tag; wrong project path in the badge URL pointing to a tagless repo.
Related errors
AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30).
Data as JSON: /api/errors/e6dfd4899dcdfa78.
Report an issue: GitHub.