Actions for GitLab Connector

  • Latest Dynatrace
  • Reference
  • 9-min read

The following workflow actions are available for the GitLab Connector GitLab for Workflows integration. Each action corresponds to an endpoint of the GitLab Connector API.

For details on creating workflows, refer to Create workflows in Dynatrace Workflows.

The actions are listed under the following categories:

Create file

Creates a new file in a new branch based on the specified base branch.

The action can only act on one file, resulting in the creation of a new branch. The GitLab API doesn't allow the reuse of existing branches. Any attempt to do so results in the GitLab API throwing an error.

Inputs

FieldDescriptionRequired
Start branchThe starting branch to base the new branch on.required
BranchThe name of the new branch.required
File pathThe relative path to the file to be created.required
File contentThe content of the new file.required
Commit messageThe commit message for the new file.required
Author nameThe name of the author of the resulting commit.optional

Output

Returns fields as described in the Repository files API - Create new file in repository GitLab documentation.

Get file

Gets a file from a repository.

This action should only be used to retrieve the contents of a plain-text file.

Inputs

FieldDescriptionRequired
File pathThe relative path of the file.required
RefThe reference from which to retrieve the file. It can be a branch name or a commit hash.required

Output

Returns fields as described in the Repository files API - Get file from repository GitLab documentation.

Update file

Updates a file in your GitLab repository. This action creates a new branch based on the specified base branch.

The action can only act on one file, resulting in the creation of a new branch. The GitLab API doesn't allow the reuse of existing branches. Any attempt to do so results in the GitLab API throwing an error.

Inputs

FieldDescriptionRequired
Start branchThe starting branch to base the new branch on.optional
BranchThe name of the new branch.required
File pathThe relative path to the file to be updated.required
File contentThe updated content of the file.required
Commit messageThe commit message for the edit.required
Author nameThe name of the author of the resulting commit.optional

Output

Returns fields as described in the Repository files API - Update existing file in repository GitLab documentation.

Delete file

Deletes a file in your GitLab repository. This action creates a new branch based on the specified base branch.

The action can only act on one file, resulting in the creation of a new branch. The GitLab API doesn't allow the reuse of existing branches. Any attempt to do so results in the GitLab API throwing an error.

Inputs

FieldDescriptionRequired
Start branchThe starting branch to base the new branch on.required
BranchThe name of the new branch.required
File pathThe relative path to the file to be deleted.required
Commit messageThe commit message for the deletion.required
Author nameThe name of the author of the resulting commit.optional

Output

Returns fields as described in the Repository files API - Delete existing file in repository GitLab documentation.

Create merge request

Creates a merge request in your GitLab repository.

Inputs

FieldDescriptionRequired
Source BranchThe name of the source branch.required
Target BranchThe name of the target branch.required
TitleThe title of the new merge request.required
DescriptionThe description of this merge request.optional

Output

Returns fields as described in the Merge requests API - Create MR GitLab documentation.

Get merge request

Gets a single merge request in GitLab.

Inputs

FieldDescriptionRequired
Internal IDThe GitLab internal identifier of the merge request.required
Commits behind the target branchToggle the switch on to include the commits behind the target branch.optional
Rebase operation in progressToggle the switch on to include any rebase operation in progress.optional

Output

Returns fields as described in the Merge requests API - Get single MR GitLab documentation.

List merge requests

Gets a list of merge requests in your GitLab repository.

Inputs

FieldDescriptionRequired
AuthorThe name of the user who authored the merge requests.optional
StateThe status of merge requests you're interested in.optional

Output

Returns fields as described in the Merge requests API - List merge requests GitLab documentation.

Merge a merge request

Merges a merge request in your GitLab repository.

Inputs

FieldDescriptionRequired
Merge requestThe merge request to merge.required
SHAThe hash of the presumptive last commit in the merge request. If the actual last commit differs, the action fails.optional
Enable squash mergeToggle the switch on to use the squash merge strategy or off to use the merge commit strategy.optional

Output

Returns fields as described in the Merge requests API - Merge a merge request GitLab documentation.

Update merge request

Updates an existing merge request in your GitLab repository.

Inputs

FieldDescriptionRequired
Merge requestThe merge request to be updated.required
BranchThe name of the target branch.required
TitleThe new title of the merge request.optional
DescriptionThe description of this merge request.optional

Output

Returns fields as described in the Merge requests API - Update MR GitLab documentation.

Create merge request note

Creates a new note for a single merge request in GitLab.

Inputs

FieldDescriptionRequired
Merge requestThe merge request to which the note will be posted.required
Content of the noteThe content of the note.required
SHAThe hash of the presumptive last commit in the merge request. If the actual last commit differs, the action fails.optional

Output

Returns fields as described in the Merge requests API - Create MR Note GitLab documentation.

Create new issue

Creates a new issue in your GitLab repository.

Inputs

FieldDescriptionRequired
TitleThe title of the new issue.required
LabelsA comma-separated list of labels to add to the issue.optional
Issue typeThe type of the issue.optional
DescriptionThe description of the issue.optional
AssigneesThe user to assign this issue. If not set, the issue will be unassigned.optional

Output

Returns fields as described in the Issues API - New issue GitLab documentation.

Edit issue

Edits an issue in your GitLab repository.

Inputs

FieldDescriptionRequired
TitleThe new title of the issue.optional
LabelsA comma-separated list of labels to apply to the issue.optional
Issue typeThe type of the issue.optional
DescriptionThe description of the issue.optional
Close/ReopenSelect to change the issue status.optional

Output

Returns fields as described in the Issues API - Edit an issue GitLab documentation.

List issues

Gets a list of issues from your GitLab repository.

Inputs

FieldDescriptionRequired
Issue IdsShow only issues with the specified, comma-separated list of IDs.optional
Title or DescriptionShow only issues that contain the specified text in their title or description.optional
Issue typeShow only issues of the specified type.optional
LabelsShow only issues with all of the comma-separated labels assigned to them.optional
StateSet whether you want to retrieve a list of open or closed issues.optional

Output

Returns fields as described in the Issues API - List issues GitLab documentation.

Get pipeline status

Gets the status of a pipeline running in your GitLab repository.

Inputs

FieldDescriptionRequired
BranchThe name of the branch.required
PipelineThe GitLab internal identifier of the pipeline.required

Output

Returns fields as described in the Jobs API - Get a single job GitLab documentation.

Trigger a new pipeline

Triggers a new run of a pipeline in your GitLab repository.

Inputs

FieldDescriptionRequired
BranchThe name of the branch for which the pipeline should be triggered.required

You can also set any number of build parameters.

Output

Returns fields as described in the Jobs API - Run a job GitLab documentation.

Related tags
Software Delivery