GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation retrieves the changes (diffs) of a specific merge request in a GitLab project using the GitLab API v4. It is useful for developers and DevOps engineers who want to programmatically access the detailed changes introduced by a merge request, such as for code review automation, CI/CD pipelines, or audit logging.

Use Case Examples

  1. Fetch the list of file changes in a merge request to display in a custom dashboard.
  2. Automatically analyze merge request diffs to enforce coding standards or detect sensitive information.
  3. Integrate merge request changes into external tools for enhanced project management.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the request, default is GET.
Query Parameters Optional query parameters for the request, including 'unidiff' to specify if the diff should be in Unified diff format.
Path Parameters Required path parameters identifying the project and merge request.

Output

JSON

  • changes - List of changes (diffs) in the merge request.
  • project_id - ID of the project.
  • merge_request_iid - Internal ID of the merge request.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and merge request IID are correct and accessible with the provided credentials.
  • Check that the GitLab API base URL is correct, especially if using a self-hosted GitLab instance.
  • Verify that the authentication token has sufficient permissions to read merge request details.

Links

Discussion