Actions66
- Branch Actions
- File Actions
- Group Actions
- Issue Actions
- Merge Request Actions
- Pipeline Actions
- Project Actions
- Raw API Actions
- Release Actions
- Tag Actions
Overview
This node operation merges a GitLab merge request into the target branch. It is useful in automated workflows where you want to programmatically finalize and integrate changes from a feature or topic branch into a mainline branch, such as main or develop. Typical scenarios include:
- Automatically merging approved merge requests after passing CI checks.
- Integrating feature branches into release branches as part of a deployment pipeline.
- Streamlining code review processes by automating the final merge step.
For example, after running tests on a feature branch, this node can be used to merge the corresponding merge request into the main branch with an optional custom commit message and merge strategy (merge or squash).
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between using saved credentials ("Credential") or specifying custom connection details ("Custom"). |
| GitLab Server | Base URL of your GitLab instance, e.g., https://gitlab.com. Used only if "Custom" authentication is selected. |
| Access Token | Personal access token with API permissions for GitLab. Used only if "Custom" authentication is selected. |
| Project Owner | Namespace or owner of the project. Ignored if "Project ID" is set. Used only if "Custom" authentication is selected. |
| Project Name | Project slug or name. Ignored if "Project ID" is set. Used only if "Custom" authentication is selected. |
| Project ID | Numeric project ID. Takes precedence over owner and name if provided. Used only if "Custom" authentication is selected. |
| Merge Commit Message | Optional commit message to use when merging the merge request. |
| Merge Strategy | How to merge the changes: either "Merge" (default) or "Squash". |
Output
The node outputs JSON data representing the result of the merge operation. This typically includes details about the merged merge request, such as its state, merge status, commit information, and any messages returned by the GitLab API.
No binary data output is produced by this operation.
Dependencies
- Requires access to a GitLab instance via its REST API.
- Needs an API authentication token with sufficient permissions to merge merge requests in the specified project.
- If using custom authentication, the user must provide the GitLab server URL, access token, and project identification details.
- The node depends on internal helper functions to build API requests and handle pagination if needed.
Troubleshooting
- Invalid Project Credentials: The node validates project credentials before making API calls. Ensure that the provided access token has the necessary scopes (e.g.,
apiorwrite_repository) and that the project ID or owner/name is correct. - Merge Conflicts or Failed Merges: If the merge request cannot be merged due to conflicts or failing pipeline status, the API will return an error. Review the merge request status in GitLab and resolve conflicts manually if needed.
- Empty or Incorrect Project Identification: When using custom authentication, providing an invalid or missing project ID or owner/name will cause errors. Make sure these fields are correctly filled.
- API Rate Limits or Network Issues: Network problems or hitting GitLab API rate limits may cause failures. Check connectivity and consider retrying later.
- Invalid Merge Strategy: Only "merge" and "squash" are supported. Using other values will cause errors.