GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the diff of a specific commit in a GitLab project's repository using the GitLab API v4. It is useful for developers or DevOps engineers who want to programmatically access the changes introduced by a particular commit, such as for code review automation, CI/CD pipelines, or audit logging.

Use Case Examples

  1. Fetch the diff of a commit identified by its SHA in a GitLab project to analyze code changes before deployment.
  2. Automate retrieval of commit diffs to generate reports on code modifications for compliance or documentation purposes.

Properties

Name Meaning
Skip Authentication Option to skip authentication when making the API request.
baseUrl The 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 pagination and diff format.
Path Parameters Required path parameters to identify the project and commit.

Output

JSON

  • diffs - Array of file diffs in the commit, showing changes made.
  • commit_id - The SHA identifier of the commit.
  • project_id - The ID of the GitLab project.
  • pagination
    • page - Current page number of the results.
    • per_page - Number of items per page in the results.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID and commit SHA are correctly specified; otherwise, the API will return errors such as '404 Not Found'.
  • If authentication is required and skipped, the request will fail with authorization errors.
  • Pagination parameters must be valid integers; invalid values may cause request failures.

Links

Discussion