Skip to content

Set GitHub Actions permissions for a repository

PUT
/repos/{owner}/{repo}/actions/permissions

Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository.

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

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

Media type application/json
object
enabled
required

Whether GitHub Actions is enabled on the repository.

boolean
allowed_actions

The permissions policy that controls the actions and reusable workflows that are allowed to run.

string
Allowed values: all local_only selected
sha_pinning_required

Whether actions must be pinned to a full-length commit SHA.

boolean
Examples
Example default
{
"enabled": true,
"allowed_actions": "selected",
"sha_pinning_required": true
}

Response