GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to approve a specific merge request within a GitLab project by sending a POST request to the GitLab API endpoint for merge request approvals. It is useful in scenarios where automated workflows need to programmatically approve merge requests as part of CI/CD pipelines or project management automation.

Use Case Examples

  1. Automatically approve a merge request after successful automated tests.
  2. Integrate merge request approvals into a larger DevOps workflow.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, 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 POST is used for this operation.
Path Parameters Parameters for the API path including project ID and merge request IID.

Output

JSON

  • approval_status - Status of the merge request approval.
  • approver - Details of the user who approved the merge request.
  • approved_at - Timestamp when the merge request was approved.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and merge request IID are correctly provided and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to approve merge requests.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and permissions.
  • Common error: 404 Not Found - indicates the project or merge request does not exist or is inaccessible.

Links

Discussion