GitLab API

GitlabTool

Actions905

Overview

This node operation allows creating a new merge request in a specified GitLab project using the GitLab API. It is useful for automating the process of initiating merge requests in GitLab repositories, which is a common task in continuous integration and development workflows. For example, it can be used to programmatically open merge requests for feature branches or bug fixes without manually using the GitLab web interface.

Use Case Examples

  1. Automatically create a merge request when a new feature branch is pushed to a GitLab repository.
  2. Trigger a merge request creation as part of a CI/CD pipeline after successful build and test stages.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the API request, defaulting to GET but here POST is used for creating merge requests.
Path Parameters Parameters to specify the project ID or URL-encoded path where the merge request will be created.

Output

JSON

  • id - The ID of the created merge request.
  • iid - Internal ID of the merge request within the project.
  • project_id - ID of the project where the merge request was created.
  • title - Title of the merge request.
  • description - Description of the merge request.
  • state - Current state of the merge request (e.g., opened, closed, merged).
  • created_at - Timestamp when the merge request was created.
  • updated_at - Timestamp when the merge request was last updated.
  • merge_status - Status of the merge request regarding mergeability.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID or URL-encoded path is correctly specified in the path parameters to avoid 404 errors.
  • Verify that the authentication credentials are valid and have sufficient permissions to create merge requests in the target project.
  • Check the request body schema to ensure all required fields for creating a merge request are provided to avoid validation errors.

Links

Discussion