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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” 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.
Request Body required
Section titled “ Request Body required ” 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
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}Responses
Section titled “ Responses ”Response