Skip to main content

default_workflow_permissions

Creates, updates, deletes, gets or lists a default_workflow_permissions resource.

Overview

Namedefault_workflow_permissions
TypeResource
Idgithub.actions.default_workflow_permissions

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
can_approve_pull_request_reviewsbooleanWhether GitHub Actions can approve pull requests. Enabling this can be a security risk.
default_workflow_permissionsstringThe default workflow permissions granted to the GITHUB_TOKEN when running workflows. (read, write)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_github_actions_default_workflow_permissions_repositoryselectowner, repoGets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
get_github_actions_default_workflow_permissions_organizationselectorgGets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization,
as well as whether GitHub Actions can submit approving pull request reviews. For more information, see
"Setting the permissions of the GITHUB_TOKEN for your organization."

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
set_github_actions_default_workflow_permissions_repositoryreplaceowner, repoSets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
set_github_actions_default_workflow_permissions_organizationreplaceorgSets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization, and sets if GitHub Actions
can submit approving pull request reviews. For more information, see
"Setting the permissions of the GITHUB_TOKEN for your organization."

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
orgstringThe organization name. The name is not case sensitive.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.

SELECT examples

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository,
as well as if GitHub Actions can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

SELECT
can_approve_pull_request_reviews,
default_workflow_permissions
FROM github.actions.default_workflow_permissions
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
;

REPLACE examples

Sets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in a repository, and sets if GitHub Actions
can submit approving pull request reviews.
For more information, see "Setting the permissions of the GITHUB_TOKEN for your repository."

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

REPLACE github.actions.default_workflow_permissions
SET
default_workflow_permissions = '{{ default_workflow_permissions }}',
can_approve_pull_request_reviews = {{ can_approve_pull_request_reviews }}
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required;