Available actions in GitLab for Workflows

Latest Dynatrace

The following workflow actions are available for the GitLab for Workflows GitLab for Workflows integration. Each action corresponds to an endpoint of the GitLab for Workflows 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

Field
Description
Required
Start branch
The starting branch to base the new branch on.
required
Branch
The name of the new branch.
required
File path
The relative path to the file to be created.
required
File content
The content of the new file.
required
Commit message
The commit message for the new file.
required
Author name
The 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

Field
Description
Required
File path
The relative path of the file.
required
Ref
The 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

Field
Description
Required
Start branch
The starting branch to base the new branch on.
optional
Branch
The name of the new branch.
required
File path
The relative path to the file to be updated.
required
File content
The updated content of the file.
required
Commit message
The commit message for the edit.
required
Author name
The 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

Field
Description
Required
Start branch
The starting branch to base the new branch on.
required
Branch
The name of the new branch.
required
File path
The relative path to the file to be deleted.
required
Commit message
The commit message for the deletion.
required
Author name
The 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

Field
Description
Required
Source Branch
The name of the source branch.
required
Target Branch
The name of the target branch.
required
Title
The title of the new merge request.
required
Description
The 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

Field
Description
Required
Internal ID
The GitLab internal identifier of the merge request.
required
Commits behind the target branch
Toggle the switch on to include the commits behind the target branch.
optional
Rebase operation in progress
Toggle 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

Field
Description
Required
Author
The name of the user who authored the merge requests.
optional
State
The 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

Field
Description
Required
Merge request
The merge request to merge.
required
SHA
The hash of the presumptive last commit in the merge request. If the actual last commit differs, the action fails.
optional
Enable squash merge
Toggle 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

Field
Description
Required
Merge request
The merge request to be updated.
required
Branch
The name of the target branch.
required
Title
The new title of the merge request.
optional
Description
The description of this merge request.
optional

Output

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

Create new issue

Creates a new issue in your GitLab repository.

Inputs

Field
Description
Required
Title
The title of the new issue.
required
Labels
A comma-separated list of labels to add to the issue.
optional
Issue type
The type of the issue.
optional
Description
The description of the issue.
optional
Assignees
The 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

Field
Description
Required
Title
The new title of the issue.
optional
Labels
A comma-separated list of labels to apply to the issue.
optional
Issue type
The type of the issue.
optional
Description
The description of the issue.
optional
Close/Reopen
Select 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

Field
Description
Required
Issue Ids
Show only issues with the specified, comma-separated list of IDs.
optional
Title or Description
Show only issues that contain the specified text in their title or description.
optional
Issue type
Show only issues of the specified type.
optional
Labels
Show only issues with all of the comma-separated labels assigned to them.
optional
State
Set 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

Field
Description
Required
Branch
The name of the branch.
required
Pipeline
The 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

Field
Description
Required
Branch
The 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.