GitLab API

GitlabTool

Actions1000

Overview

This node operation allows updating a specific merge request in a GitLab project by sending a PUT request to the GitLab API endpoint `/api/v4/projects/{id}/merge_requests/{merge_request_iid}/merge`. It is useful for scenarios where you need to programmatically merge or update merge requests in GitLab projects, such as automating code review workflows or integrating GitLab merge request management into other systems.

Use Case Examples

  1. Automatically merge a merge request after passing CI tests.
  2. Update merge request details as part of a deployment pipeline.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication to use for the API request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but PUT is used for this operation.
Path Parameters Parameters to specify the project ID and merge request IID to identify the merge request to update.

Output

JSON

  • id - The ID of the updated merge request.
  • title - The title of the merge request.
  • state - The current state of the merge request (e.g., merged, opened).
  • merged_by - User who merged the merge request.
  • merged_at - Timestamp when the merge request was merged.
  • description - Description of the merge request.
  • source_branch - Source branch of the merge request.
  • target_branch - Target branch of the merge request.

Dependencies

  • GitLab API key credential

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 update merge requests.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated requests for this operation.
  • Common error messages include 404 Not Found if the merge request or project does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion