GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves references (branches, tags, or all) associated with a specific commit in a GitLab project repository. It is useful for scenarios where you need to find out which branches or tags contain a particular commit, such as tracking changes, auditing, or managing releases.

Use Case Examples

  1. Get all branches and tags that include a specific commit SHA in a project.
  2. Fetch only the branches that contain a given commit for release management.
  3. Paginate through references to handle large repositories with many branches or tags.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, defaulting to GET.
Query Parameters Optional parameters to filter and paginate the results.
Path Parameters Required parameters to identify the project and commit.

Output

JSON

  • id - The unique identifier of the reference.
  • name - The name of the branch or tag.
  • type - The type of reference, e.g., branch or tag.
  • commit
    • id - The commit SHA.
    • message - The commit message.
    • author_name - The name of the commit author.
    • author_email - The email of the commit author.
    • created_at - The timestamp when the commit was created.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and commit SHA are correctly provided and URL-encoded if necessary.
  • Verify that the authentication token has sufficient permissions to access the project repository.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Handle pagination properly if the number of references exceeds the per_page limit.
  • Common error: 404 Not Found - This may indicate the project or commit does not exist or is inaccessible.
  • Common error: 401 Unauthorized - This indicates authentication failure; check API token validity.

Links

Discussion