GitLab API

GitlabTool

Actions905

Overview

This node operation cancels the automatic merge of a specified merge request in a GitLab project when the pipeline succeeds. It is useful in scenarios where a merge request was set to merge automatically after a successful pipeline, but the user decides to cancel this automatic merge before it happens. For example, if a developer wants to halt the merge process due to new changes or issues discovered after the pipeline started, this operation can be used to stop the merge.

Use Case Examples

  1. Cancel the automatic merge of a merge request in a GitLab project by specifying the project ID and the merge request IID.
  2. Use this operation to manage merge requests in CI/CD workflows where automatic merges are controlled programmatically.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the API request.
Authentication The authentication method used for the API request, typically an API key credential.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the API request, default is POST.
Path Parameters Parameters required in the API path to identify the project and merge request.

Output

JSON

  • status - The status of the cancel merge operation response from GitLab API.
  • message - Any message returned by the API regarding the cancel merge operation.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and merge request IID are correct and exist in the GitLab instance.
  • Verify that the API authentication credentials are valid and have sufficient permissions to modify 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 may include authentication failures, resource not found (invalid project or merge request ID), or permission denied errors. Resolving these typically involves correcting credentials, IDs, or user permissions.

Links

Discussion