Actions66
- Branch Actions
- File Actions
- Group Actions
- Issue Actions
- Merge Request Actions
- Pipeline Actions
- Project Actions
- Raw API Actions
- Release Actions
- Tag Actions
Overview
The node provides extended integration with GitLab, allowing users to manage various GitLab resources programmatically within n8n workflows. Specifically for the Branch - Merge operation, it enables merging one branch into another within a GitLab project repository.
This operation is useful in scenarios such as:
- Automating the merging of feature branches into main or development branches after successful testing.
- Integrating GitLab branch merges into CI/CD pipelines or deployment workflows.
- Streamlining code review and merge processes by triggering merges based on external events or approvals.
For example, you can configure this node to merge a feature branch feature/login into the main branch automatically once all tests pass, reducing manual intervention.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between using saved credentials ("Credential") or providing 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. |
| Branch | The source branch name to be merged, e.g., feature/login. Required. |
| Target Branch | The target branch into which the source branch will be merged, e.g., main. Required. |
Output
The node outputs JSON data representing the result of the merge operation as returned by the GitLab API. This typically includes details about the merge status, commit information, and any messages related to the merge request.
If the merge is successful, the output JSON will contain confirmation and metadata about the merged branches. If there is an error (e.g., conflicts or permission issues), the output will include error details.
No binary data output is involved in this operation.
Dependencies
- Requires access to a GitLab instance, either the public GitLab server (
https://gitlab.com) or a self-hosted GitLab server. - Requires an API access token with appropriate permissions to read and write branches and perform merge operations.
- The node supports two authentication modes: using stored credentials or custom fields for connection details.
- No additional external dependencies beyond standard GitLab API access.
Troubleshooting
- Invalid Project Identification: Ensure that either the numeric Project ID is provided or both Project Owner and Project Name are correctly specified when using custom authentication.
- Authentication Errors: Verify that the access token has sufficient permissions to perform branch merges.
- Merge Conflicts: If the merge cannot be performed due to conflicts, the API will return an error. Resolve conflicts manually or via other automated steps before retrying.
- Branch Not Found: Confirm that both the source branch (
Branch) and target branch (Target Branch) exist in the repository. - API Rate Limits: Be aware of GitLab API rate limits which might affect repeated merge attempts in short intervals.
Common error messages usually relate to authorization failures, missing branches, or merge conflicts. Checking the exact error message in the node output helps identify the cause.