Sample - GitHub REST API
GET/repos/{owner}/{repo}/actions/permissions/workflow

Get default workflow permissions for a repository

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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.

1 status code
200Response
default_workflow_permissionsstringrequired
The default workflow permissions granted to the GITHUB_TOKEN when running workflows.
Allowed:readwrite
can_approve_pull_request_reviewsbooleanrequired
Whether GitHub Actions can approve pull requests. Enabling this can be a security risk.