GitLab API

GitlabTool

Actions1000

Overview

This node operation creates a new branch in a GitLab project repository. It is useful for automating branch creation workflows in GitLab projects, such as when setting up new features, bug fixes, or release branches programmatically.

Use Case Examples

  1. Automatically create a feature branch in a GitLab project when a new task is created in a project management tool.
  2. Create a release branch in GitLab as part of a CI/CD pipeline triggered by a version bump.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used for the request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but can be set to POST, PUT, DELETE, HEAD, or PATCH.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path.

Output

JSON

  • id - The ID or URL-encoded path of the project for which the branch is created.
  • branchName - The name of the branch created in the repository.
  • commitInfo - Details about the commit from which the branch is created, typically including commit SHA and message.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • Verify that the branch name in the request body is valid and does not already exist in the repository.
  • Check that the base URL is correctly set to the GitLab instance you are targeting, especially if using a self-hosted GitLab server.
  • Common error messages include authentication failures (check API key validity), 404 errors if the project ID is incorrect, and 400 errors if the request body schema is invalid.

Links

Discussion