Actions for GitHub Connector

  • Latest Dynatrace
  • Reference
  • 6-min read

This page contains Github workflow actions that are available for the GitHub Connector GitHub integration.

Required token permissions to run all GitHub actions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Contents > Read and write.

Select Repository permissions > Pull requests > Read and write.

Select Repository permissions > Workflows > Read and write.

Select Repository permissions > Issues > Read and write.

Select Repository permissions > Actions > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Contents > Read and write.

Select Repository permissions > Pull requests > Read and write.

Select Repository permissions > Workflows > Read and write.

Select Repository permissions > Issues > Read and write.

Select Repository permissions > Actions > Read and write.

Token (classic)

public

Select scopes > repo > public_repo.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Get content

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

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
File pathThe file path to a single, existing file. A directory path is not supported.Required
ReferenceThe 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.

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

No additional permissions are required.

Fine-grained personal access token

private

Select Repository permissions > Contents > Read only.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

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

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Create new branchSelect this option if you want the change to be made in a new branch.Optional
Commit to an existing branchSelect this option if you're going to use an existing branch for the change.Optional
Source branchThe source branch on which the new branch is based. For example: main.Optional
BranchThe new or existing branch you want to commit to.Required
File pathThe relative path to the file. A directory path is not supported. Existing files will be overwritten.Required
File contentThe full content of the file. Existing files will be overwritten.Required
Commit messageThe 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.

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Contents > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Contents > Read and write.

Select Repository permissions > Workflows > Read and write. (required to modify GitHub workflow files)

Token (classic)

public

Select scopes > repo > public_repo.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

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

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Create new branchSelect this option if you want the file deletion to be made in a new branch.Optional
Commit to an existing branchSelect this option if you're going to use an existing branch for the change.Optional
Source branchThe source branch on which the new branch is based, for instance, "main".Optional
BranchThe new or existing branch you want to commit to.Required
File pathThe relative path to the file to be deleted. A directory path is not supported.Required
Commit messageThe 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.

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Contents > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Contents > Read and write.

Token (classic)

public

Select scopes > repo > public_repo.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

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

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Source branchThe source branch where the changes are implemented.Required
Target branchThe target branch you want the changes to be pulled into.Required
Pull request titleThe title of the pull request.Required
Pull request descriptionThe description of the pull request.Optional

Output

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

Required permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Pull requests > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Pull requests > Read and write.

Token (classic)

public

Select scopes > repo > public_repo.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Get pull request

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

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Pull request numberThe 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.

Required permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

No additional permissions are required.

Fine-grained personal access token

private

Select Repository permissions > Pull requests > Read-only.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control) of private repositories.

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

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
StateThe 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.

Required permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

No additional permissions are required.

Fine-grained personal access token

private

Select Repository permissions > Pull requests > Read-only.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Merge pull request

The Merge pull request action merges the specified pull request.

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Pull request numberThe number that identifies the pull request.Required
Merge MethodThe merge method to use.Optional

Output

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

Required permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Contents > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Contents > Read and write.

Token (classic)

public

Select scopes > repo > public_repo.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Create issue

The Create issue action creates a new issue in a specified repository.

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Issue TitleThe title of the issue to be created.Required
DescriptionThe description or body of the issue.Optional
AssigneesA list of usernames to assign to the issue.Optional
LabelsA list of labels to associate with the issue.Optional

Output

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

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Issues > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Issues > Read and write.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Update issue

The Update issue action updates an existing issue in a specified repository. Use the Add Field option to specify fields for updates.

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Issue NumberThe number of the issue to be updated.Required
TitleThe new title of the issue. Displayed only after the field is added. Leaving the added field empty updates it with an empty value.Optional
DescriptionThe new description or body of the issue. Displayed only after the field is added. Leaving the added field empty updates it with an empty value.Optional
StateThe new state of the issue. Displayed only after the field is added. Leaving the added field empty updates it with an empty value.Optional
AssigneesThe new list of usernames to assign to the issue. Displayed only after the field is added. Leaving the added field empty updates it with an empty value.Optional
LabelsThe new list of labels to associate with the issue. Displayed only after the field is added. Leaving the added field empty updates it with an empty value.Optional

Output

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

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Issues > Read and write.

Select Repository permissions > Pull requests > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Issues > Read and write.

Select Repository permissions > Pull requests > Read and write.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Create comment

The Create comment action creates a new comment on an issue or pull request in a specified repository.

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
Issue or pull request IDThe ID of the issue or pull request to which the comment will be added.Required
ContentThe content of the comment to be created.Required

Output

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

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Issues > Read and write.

Select Repository permissions > Pull requests > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Issues > Read and write.

Select Repository permissions > Pull requests > Read and write.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Trigger workflow run

The Trigger workflow run action triggers a workflow in a specified repository. The workflow must be configured to run on the workflow_dispatch event. If the workflow calls reuseable workflows from other private repositories, you can make them accessible in Settings > Actions > General > Access on GitHub.

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
WorkflowThe ID of the workflow or the workflow file name including the .yml or .yaml extension.Required
ReferenceThe name of the branch or tag for the workflow. For example: main.Required
InputsKey-value pairs of input parameters to pass to the workflow in JSON format.Optional

Output

The action returns no result.

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Actions > Read and write.

Fine-grained personal access token

private

Select Repository permissions > Actions > Read and write.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Get latest workflow run

The Get latest workflow run action retrieves data from the latest run workflow in a specified repository.

Input

FieldDescriptionRequired
ConnectionConnection to your GitHub environment.Required
OwnerAccount owner of the repository (private user or organization).Required
RepositoryThe name of the repository without the .git extension. The name is not case-sensitive.Required
WorkflowThe ID of the workflow or the workflow file name including the .yml or .yaml extension.Required
BranchThe name of the branch or tag. For example: main.Optional

Output

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

Required token permissions

Token type

Repository type

Permissions

Fine-grained personal access token

public

Select Repository permissions > Actions > Read.

Fine-grained personal access token

private

Select Repository permissions > Actions > Read.

Token (classic)

public

No additional permissions are required.

Token (classic)

private

Select scopes > repo (Full control of private repositories).

Related tags
Software Delivery