GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the changes 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 diff or changes introduced by a merge request for review, automation, or integration purposes. For example, it can be used to fetch the list of file changes in a merge request to trigger automated tests or code quality checks.

Use Case Examples

  1. Fetch changes of merge request IID 42 in project with ID 'my-group/my-project' to review code diffs.
  2. Retrieve merge request changes with unified diff format enabled for detailed patch analysis.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request (boolean). Defaults to false.
Authentication The authentication method to use for the API request, hidden unless Skip Authentication is false. Defaults to GitLab API key.
baseUrl The base URL of the GitLab instance. Defaults to https://gitlab.com.
Method HTTP method to use for the request. Defaults to 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 IID.

Output

JSON

  • changes - List of changes in the merge request, including file diffs and metadata.
  • project_id - The ID or path of the project.
  • merge_request_iid - The internal ID of the merge request.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key credential is valid and has sufficient permissions to access the merge request data.
  • If skipping authentication, confirm that the GitLab instance allows unauthenticated access to the requested endpoint.

Links

Discussion