GitHub for Workflows actions

Latest Dynatrace

The following workflow actions are available for the GitHub for Workflows GitHub integration.

Get content

The Get content action returns the content of an existing file in the repository.

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
File path
The file path to a single, existing file. A directory path is not supported.
required
Reference
The name of the commit, branch or tag. If not set, the repository's default branch is used.
optional

Output

The action returns the content property that contains the plain text content of an existing file in the repository.

Create or replace file

The Create or replace file action creates a new file with the specified content or replaces an existing one. Next, it commits the change to a newly created branch using the specified source branch or the specified existing branch.

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
Create new branch
Select this option if you want the change to be made in a new branch.
optional
Commit to an existing branch
Select this option if you're going to use an existing branch for the change.
optional
Source branch
The source branch on which the new branch is based (for example, "main").
optional
Branch
The new or existing branch you want to commit to.
required
File path
The relative path to the file. A directory path is not supported. Existing files will be overwritten.
required
File content
The full content of the file. Existing files will be overwritten.
required
Commit message
The git commit message for the change.
required

Output

The action returns the fileMetadata property that contains the full response of the corresponding GitHub API endpoint.

Delete file

The Delete file action deletes an existing file in the repository and commits the change to either a newly created branch using the specified source branch as a basis or uses the specified existing branch.

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
Create new branch
Select this option if you want the file deletion to be made in a new branch.
optional
Commit to an existing branch
Select this option if you're going to use an existing branch for the change.
optional
Source branch
The source branch on which the new branch is based, for instance, "main".
optional
Branch
The new or existing branch you want to commit to.
required
File path
The relative path to the file to be deleted. A directory path is not supported.
required
Commit message
The git commit message for the change.
required

Output

The action returns the fileMetadata property that contains the full response of the corresponding GitHub API endpoint.

Create pull request

The Create pull request action creates a pull request for an existing branch and the specified target branch (for example, main).

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
Source branch
The source branch where the changes are implemented.
required
Target branch
The target branch you want the changes to be pulled into.
required
Pull request title
The title of the pull request.
required
Pull request description
The description of the pull request.
optional

Output

The action returns the pullRequest property that contains the full response of the corresponding GitHub API endpoint.

Get pull request

The Get pull request action returns details about the specified pull request.

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
Pull request number
The number that identifies the pull request.
required

Output

The action returns the pullRequest property that contains the full response of the corresponding GitHub API endpoint.

List pull requests

The List pull requests action returns a list of pull requests that match the specified criteria. The limit of 30 pull requests applies.

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
State
The state of pull requests you're interested in (open, closed, all).
optional

Output

The action returns the pullRequest property that contains the full response of the corresponding GitHub API endpoint.

Merge pull request

The Merge pull request action merges the specified pull request.

Input

Field
Description
Required
Connection
Connection to your GitHub environment.
required
Owner
Account owner of the repository (private user or organization).
required
Repository
The name of the repository without the .git extension. The name is not case-sensitive.
required
Pull request number
The number that identifies the pull request.
required
Merge Method
The merge method to use.
optional

Output

The action returns the mergeStatus property that contains the full response of the corresponding GitHub API endpoint.