GitLab API

GitlabTool

Actions905

Overview

This node operation retrieves references (branches, tags, or all) associated with a specific commit SHA in a GitLab project repository. It is useful for developers or DevOps engineers who want to track where a particular commit is referenced within the repository, such as which branches or tags include that commit. For example, it can be used to find all branches containing a bug fix commit or to verify if a commit has been tagged for release.

Use Case Examples

  1. Retrieve all references (branches and tags) for a commit SHA in a project to understand its usage across the repository.
  2. Get only branches referencing a specific commit to check active development lines including that commit.
  3. Paginate through references if there are many, controlling page size and number.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, default is GET.
Parameter Schema Defines required and optional parameters for the API call, including project ID, commit SHA, and query parameters like type (branch, tag, all), page, and per_page for pagination.
Query Parameters Optional query parameters to filter and paginate the references returned, such as type (branch, tag, all), page number, and items per page.
Path Parameters Required path parameters specifying the project ID and commit SHA to identify the commit whose references are being retrieved.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • sha - The commit SHA identifier.
  • type - The scope of references to retrieve: branch, tag, or all.
  • page - The current page number of the paginated results.
  • per_page - The number of items per page in the paginated results.
  • refs - The list of references (branches or tags) associated with the commit.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID and commit SHA are correctly specified; incorrect values will result in errors or empty results.
  • Authentication errors may occur if the API key or token is missing, invalid, or lacks sufficient permissions.
  • Pagination parameters (page, per_page) should be valid integers; invalid values may cause request failures.

Links

Discussion