GitLab API icon

GitLab API

Gitlab

Actions917

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 or branch/tag name within 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 analyze changes made in a specific commit.
  2. Retrieve commit stats to understand the number of additions and deletions in a commit for reporting purposes.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, defaulting to GET.
Parameter Schema Defines the required path and query parameters for the API call, including project ID, commit SHA, and optional stats flag.
Request Body Schema The schema for the request body, which is null for this GET operation.
Request Path The API endpoint path template for retrieving commit details.
Query Parameters Optional query parameters for the API call, such as 'stats' to include commit statistics.
Path Parameters Path parameters specifying the project ID and commit SHA or branch/tag name.

Output

JSON

  • id - The unique identifier of the commit.
  • short_id - A shortened version of the commit SHA.
  • title - The commit title or message summary.
  • author_name - Name of the commit author.
  • author_email - Email of the commit author.
  • committed_date - The date and time when the commit was made.
  • 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 for authentication

Troubleshooting

  • Ensure the project ID and commit SHA or branch/tag name are correctly URL-encoded and valid to avoid 404 errors.
  • If authentication is required, verify that the GitLab API key credential is correctly configured and has sufficient permissions.
  • Check the 'stats' query parameter to ensure it is a boolean or string that the API accepts; incorrect values may cause errors.

Links

Discussion