This action requires a token for the user on whose behalf it will run.

CreateGitlabBranches — creates new branches in the target repository.

Request example

project_id: '0'
branches:
  - branch: new-branch
    ref: main

Request specification

NameRequiredDescription
project_idYesIdentifier of the project in which to create the branches
branchesYesList of branches to create
branches.branchYesName of the new branch
branches.refYesName of an existing branch or a commit SHA

Note

The action performs a POST request to the URL /api/v4/projects/:id/repository/branches for each branch in the list, in order. If GitLab does not create a branch, the action fails, and the branches created before it remain in the project. The action does not return a response: {{ .response }} is empty.