GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node interacts with the GitLab API to approve a specific merge request within a project. It is useful in automated workflows where merge request approvals need to be managed programmatically, such as in CI/CD pipelines or project management automation. For example, it can be used to automatically approve merge requests after certain checks pass or to integrate approval processes into broader automation systems.

Use Case Examples

  1. Automatically approve a merge request after successful build and test stages.
  2. Integrate merge request approvals into a custom project management dashboard.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters required in the URL path to identify the project and merge request.

Output

JSON

  • approval_status - The status of the merge request approval after the operation.
  • approvals_required - Number of approvals required for the merge request.
  • approvals_left - Number of approvals still needed.
  • approved_by - List of users who have approved the merge request.

Dependencies

  • GitLab API authentication token

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified; incorrect values will cause the API call to fail.
  • Verify that the authentication token has sufficient permissions to approve merge requests.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid project or merge request), and 403 Forbidden (insufficient permissions). Resolving these involves verifying credentials, permissions, and input parameters.

Links

Discussion