Skip to content

Feature Request: Add API to fetch a release by tag #161

Description

@FliPPeDround

Describe the feature

Currently, UNGH provides an API endpoint to fetch all releases for a repository (/repos/{owner}/{name}/releases). This is great for retrieving the entire release history, but there is no efficient way to fetch a specific release by its tag name.

A common use case is needing to fetch metadata or assets for a single, specific release (e.g., the release associated with a specific version tag). With the current API, one would have to fetch the entire list of releases and then filter it on the client side, which is inefficient and increases bandwidth usage, especially for repositories with a long release history.

I would like to request a new API endpoint to fetch a single release by its tag name.

Proposed Solution

Add a new API endpoint that follows the existing UNGH API pattern:

  • Endpoint: /repos/{owner}/{name}/releases/tags/{tag}
  • Method: GET
  • Description: Get a specific release by its tag name.

Example Request:

GET https://ungh.cc/repos/nuxt/framework/releases/tags/v3.0.0-rc.13

Expected Response:

The response should return the release object for the specified tag, similar to the structure returned in the array from the current /releases/latest endpoint.

{
  "release": {
    "id": 82066265,
    "tag": "v3.0.0-rc.13",
    "author": "pi0",
    "name": "v3.0.0-rc.13",
    "draft": false,
    "prerelease": false,
    "createdAt": "2022-11-04T11:37:49Z",
    "publishedAt": "2022-11-04T11:41:59Z",
    "markdown": "....",
    "html": "..."
  }
}

Why This is Useful

  • Efficiency: Eliminates the need to fetch all releases just to find one by tag name, saving bandwidth and improving response times.
  • Simplicity: Provides a direct, semantic way to access a release, aligning with common user expectations (e.g., "get the release for version 1.0.0").
  • Consistency: Follows the established pattern of UNGH's other single-resource endpoints (e.g., /repos/{owner}/{name}/releases for the list and /repos/{owner}/{name}/releases/tags/{tag} for a single item).

Alternative Solutions
Continue using the existing /releases endpoint and filter client-side. (This is the current workaround, but is inefficient.)

Additional context
This feature would complement the existing releases functionality and make UNGH an even more powerful and user-friendly tool for interacting with GitHub release metadata. It is a small, focused addition that provides significant value.

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions