GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the diffs of a specific merge request from a GitLab project using the GitLab API. It is useful for developers and DevOps engineers who want to programmatically access the changes introduced by a merge request to review code differences, perform automated checks, or integrate with other tools.

Use Case Examples

  1. Fetch the diff of a merge request to display code changes in a custom dashboard.
  2. Automate code review processes by retrieving merge request diffs and analyzing them with custom scripts.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically a GitLab API key.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method to use for the API request, default is GET.
Query Parameters Optional query parameters to control pagination and diff format.
Path Parameters Required path parameters to identify the project and merge request.

Output

JSON

  • diffs - Array of diffs for the specified merge request.
  • project_id - ID of the project containing the merge request.
  • merge_request_iid - Internal ID of the merge request.

Dependencies

  • GitLab API authentication token or API key

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified; otherwise, the API will return an error.
  • Check that the authentication token has sufficient permissions to access the project's merge requests.
  • If pagination parameters are used, verify that page and per_page values are valid integers.
  • If the API returns an error about the base URL, confirm that the baseUrl property is correctly set to your GitLab instance URL.

Links

Discussion