GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation retrieves detailed information about a specific commit in a GitLab project repository using the GitLab API v4. It is useful for scenarios where you need to fetch commit details such as author, message, date, and optionally commit statistics for a given commit SHA, branch, or tag in a project. For example, it can be used in CI/CD pipelines, audit logs, or project analytics to get commit metadata.

Use Case Examples

  1. Fetch commit details by providing the project ID and commit SHA to monitor changes in a repository.
  2. Retrieve commit statistics to analyze code changes for a specific commit in a GitLab project.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public repositories or testing.
Authentication Type of authentication used for the request, defaults to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters for the request, including 'stats' to include commit statistics.
Path Parameters Path parameters required for the request, including 'id' for the project ID or URL-encoded path, and 'sha' for the commit SHA, branch, or tag name.

Output

JSON

  • id - The unique identifier of the commit.
  • short_id - Shortened version of the commit SHA.
  • title - Title or message of the commit.
  • author_name - Name of the commit author.
  • author_email - Email of the commit author.
  • created_at - Timestamp when the commit was created.
  • committed_date - Date when the commit was committed.
  • stats
    • additions - Number of lines added in the commit (if stats included).
    • deletions - Number of lines deleted in the commit (if stats included).
    • total - Total number of changes in the commit (if stats included).

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and commit SHA/path are correctly URL-encoded to avoid 404 errors.
  • If authentication is required, verify that the GitLab API key credential is valid and has sufficient permissions.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure the URL is correct.
  • If the 'stats' query parameter is used, ensure it is a boolean value; otherwise, the API may ignore it or return an error.

Links

Discussion