GitLab API icon

GitLab API

Gitlab

Actions917

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 branches or tags in a project. For example, it can be used to find all branches or tags that include a given commit, aiding in release management or debugging.

Use Case Examples

  1. Get all references (branches and tags) for a specific commit SHA in a GitLab project.
  2. Retrieve only branch references for a commit to see which branches contain it.
  3. Paginate through references if there are many, by specifying page number and items per page.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to connect to, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Parameter Schema Defines the required and optional parameters for the API call, including project ID, commit SHA, type of reference (branch, tag, or all), pagination page, and items per page.
Query Parameters Optional query parameters to filter and paginate the results, including type (branch, tag, all), page number, and items per page.
Path Parameters 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 for paginated results.
  • per_page - The number of items per page in paginated results.
  • refs - The list of references (branches or tags) associated with the commit.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and commit SHA are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to access the project repository.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • If pagination parameters are used, ensure page and per_page values are valid integers.

Links

Discussion