GitLab API

GitlabTool

Actions1000

Overview

This node operation interacts with the GitLab API to cancel the automatic merge of a specific merge request when its pipeline succeeds. It is useful in scenarios where a user wants to programmatically stop a merge request from being merged automatically after the pipeline completes successfully, providing control over merge workflows in GitLab projects.

Use Case Examples

  1. Cancel the automatic merge of a merge request in a GitLab project when the pipeline succeeds to prevent unintended merges.
  2. Use in CI/CD automation to halt merge requests that should not be merged automatically after pipeline success.

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 authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method used for the API request, defaulting to GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters required in the API request path to identify the project and merge request.

Output

JSON

  • statusCode - HTTP status code returned by the API indicating the result of the cancel merge request operation.
  • responseBody - The JSON response body from the GitLab API after attempting to cancel the merge when pipeline succeeds.

Dependencies

  • GitLab API credentials for authentication

Troubleshooting

  • Ensure the project ID and merge request IID are correctly provided and valid to avoid 404 Not Found errors.
  • Verify that the API authentication credentials are correctly configured and have sufficient permissions to modify merge requests.
  • Check the HTTP method is set appropriately, typically POST for this operation, to avoid method not allowed errors.

Links

Discussion