Personal Access Token Permissions and User Roles for GitHub

Classic Personal Access Token Permissions

Certain personal access token permissions and user roles are required to perform backups and restores for GitHub.

Operation

Context

Personal access token permissions

User roles (member of the organization)

Backup

All contexts

  • Full permissions at the repo scope level for private repositories

  • Public_repo permission at the repo scope level for public repositories

  • User must have the Read role at the Organization level or at the Repository level

Restore

If the destination repository does not exist

  • Full permissions at the repo scope level for private repositories

  • Public_repo permissions at the repo scope level for public repositories

  • If a workflow is present in the repository, full permissions at the workflow scope level for public and private repositories

  • User must have the Create repository permission enabled

  • User will be set with the Admin role for the repository created by the restore operation

If the destination repository exists

  • Full permissions at the repo scope level for private repositories

  • Public_repo permissions at the repo scope level for public repositories

  • If a workflow is present in the repository, full permissions at the workflow scope for public and private repositories

  • User must have the Write role at the Organization level or at the Repository level

Fine-Grained Personal Access Token Permissions

Fine-grained personal access token permissions are required to back up and restore GitHub repositories.

Permission scopes

Backup

Restore

Administration

Read permission to view the administrative settings and configurations of a private project repository without making any changes.

Read and write permissions to view and modify the administrative settings and configurations of a repository.

Commit statuses

Read permission to view the statuses of commits within a private repository.

Read and write permissions to update the statuses of commits during the restore process to ensure they reflect the state captured in the backup.

Contents

Read permission to view the contents of a private repository, including files, directories, commit history, branches, tags, and releases.

Read and write permissions to modify and recreate repository contents, configurations, and collaborative elements such as issues and pull requests.

Custom properties

Read permission to access and retrieve the custom metadata or properties associated with the private repository elements.

Read and write permissions to modify or update the custom metadata.

Metadata

Read permission for read-only access to the basic private repository and user information, such as names, descriptions, and visibility.

Not applicable.

Pull requests

Read permission to access and read all pull requests within a private repository, including their descriptions, comments, reviews, and statuses.

Read and write permissions provide full control over pull requests, enabling both viewing and editing capabilities.

Webhooks

Read permission to view the webhook configurations, URLs, and event subscriptions of a private repository.

Read and write permissions to view, create, modify, and delete webhooks in a repository.

Workflows

Not required

Read and write permissions to push workflow files in a repository

×

Loading...