GitLab API

GitlabTool

Actions905

Overview

This node operation allows users to approve a specific merge request within a GitLab project by making a POST request to the GitLab API endpoint for approving merge requests. It is useful in automated workflows where merge requests need to be programmatically approved as part of CI/CD pipelines or project management automation.

Use Case Examples

  1. Automatically approve a merge request after successful CI tests.
  2. Approve merge requests based on specific conditions in a workflow.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is POST for this operation.
Path Parameters Parameters for the API path including project ID and merge request IID.

Output

JSON

  • id - The ID of the approved merge request.
  • iid - The internal ID of the approved merge request.
  • project_id - The ID of the project containing the merge request.
  • approved_by - List of users who approved the merge request.
  • approvals_required - Number of approvals required for the merge request.
  • approved_at - Timestamp when the merge request was approved.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and merge request IID are correct and exist in the GitLab instance.
  • Verify that the API key has sufficient permissions to approve merge requests.
  • Check the base URL to ensure it points to the correct GitLab instance.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and authentication settings.
  • Common error: 404 Not Found - indicates the project or merge request does not exist or is inaccessible.

Links

Discussion