GitLab API

GitlabTool

Actions905

Overview

This node operation deletes a specific merge request from a GitLab project using the GitLab API. It is useful for automating the removal of merge requests in GitLab projects, for example, when cleaning up outdated or unwanted merge requests programmatically.

Use Case Examples

  1. Automatically delete a merge request after it has been merged or closed.
  2. Remove a merge request that was created by mistake via an automated workflow.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using 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 but DELETE is used for this operation.
Path Parameters Parameters used in the API request path to identify the project and merge request to delete.

Output

JSON

  • success - Indicates whether the merge request was successfully deleted.
  • statusCode - HTTP status code returned by the API after the delete request.

Dependencies

  • GitLab API key credential for authentication

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 delete merge requests.
  • Check the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab.
  • Common error messages include 404 Not Found if the merge request or project does not exist, and 403 Forbidden if the API key lacks delete permissions.

Links

Discussion