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 allows you to rename a branch in a GitLab project. It is useful when you want to change the name of an existing branch, for example, to reflect updated feature names or fix naming conventions without deleting and recreating branches manually.
Typical scenarios include:
- Renaming a feature branch after deciding on a better descriptive name.
- Correcting typos in branch names.
- Organizing branches by renaming them according to new team standards.
Example: Rename the branch feature/login to feature/authentication in your GitLab repository to better describe its purpose.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose between using saved credentials ("Credential") or entering 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 | Current name of the branch to rename (required). Example: feature/login. |
| New Branch | New name for the branch (required). Example: feature/authentication. |
Output
The output JSON contains the response from the GitLab API after renaming the branch. This typically includes details about the renamed branch such as its new name, commit information, and related metadata.
No binary data is output by this operation.
Dependencies
- Requires access to a GitLab instance via API.
- Needs either saved credentials or custom authentication fields including a valid personal access token with appropriate permissions to manage branches.
- The node uses internal helper functions to build the project base URL and make authenticated API requests to GitLab.
Troubleshooting
- Invalid Project Credentials: If the credentials are missing or invalid, the node will throw an error. Ensure that the personal access token has sufficient permissions to modify branches.
- Branch Not Found: If the specified current branch does not exist, the API will return an error. Verify the branch name is correct.
- New Branch Name Conflicts: If the new branch name already exists, the rename operation may fail. Choose a unique new branch name.
- Project Identification Issues: When using custom authentication, ensure that either the numeric project ID is provided or both project owner and project name are correctly set.
- API Rate Limits or Network Issues: Network problems or GitLab API rate limits can cause failures. Check connectivity and API usage quotas.