GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to approve a specific merge request within a GitLab project via the GitLab API. It is useful in automated workflows where merge requests need to be programmatically approved as part of a CI/CD pipeline or project management automation. For example, a team could automate the approval of merge requests that pass certain tests or meet specific criteria without manual intervention.

Use Case Examples

  1. Automatically approve merge requests after successful automated testing.
  2. Integrate merge request approval into a deployment pipeline to streamline code merging.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters to specify the project ID and the merge request IID to identify which merge request to approve.

Output

JSON

  • statusCode - HTTP status code returned by the API after attempting to approve the merge request.
  • body - Response body containing details about the approved merge request or error information.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and merge request IID are correctly specified and exist in the GitLab instance.
  • Verify that the API key used has sufficient permissions to approve merge requests.
  • Check the base URL to ensure it points to the correct GitLab instance if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (invalid or missing API key), 404 Not Found (invalid project or merge request ID), and 403 Forbidden (insufficient permissions).

Links

Discussion