Azure-devops-docs: What are the GitHub scopes needed when creating a personal access token?

Created on 14 Jul 2018  Â·  8Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

I'm trying to follow the principle of least privilege however I'm unclear which are the minimal set of scopes I should grant the personal access token I'm creating for the VSTS integration.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 devops-cictech devopprod doc-bug stale-issue vstsvc

Most helpful comment

there is a better article outlining the permissions details here: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml

Scraped from the PAT section.

Repository permissions for Personal access token (PAT) authentication
To create a pipeline for your repository with continuous integration and pull request triggers, you must have the required GitHub permissions configured. Otherwise, the repository will not appear in the repository list while creating a pipeline. Depending on the authentication type and ownership of the repository, ensure that the following access is configured.

If the repo is in your personal GitHub account
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.

If the repo is in someone else's personal GitHub account
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.
You must be added as a collaborator in the repository's settings under "Collaborators". Accept the invitation to be a collaborator using the link that is emailed to you.
If the repo is in a GitHub organization that you own
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.
You must be added as a collaborator, or your team must be added, in the repository's settings under "Collaborators and teams".
If the repo is in a GitHub organization that someone else owns
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.
You must be added as a collaborator, or your team must be added, in the repository's settings under "Collaborators and teams". Accept the invitation to be a collaborator using the link that is emailed to you.

All 8 comments

@gsacavdm see here for more detailed explanation of each of the scopes https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/

check out repo and public repo .. right now there is not like a "read-only" for code only type scope

Thanks @mlearned , to confirm, you're saying that the only permission I need is repo_deployment / public repo, correct?

Is there are reason this isn't listed in this VSTS doc?

Ping @mlearned :)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Ping @mlearned

ping @mlearned

there is a better article outlining the permissions details here: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml

Scraped from the PAT section.

Repository permissions for Personal access token (PAT) authentication
To create a pipeline for your repository with continuous integration and pull request triggers, you must have the required GitHub permissions configured. Otherwise, the repository will not appear in the repository list while creating a pipeline. Depending on the authentication type and ownership of the repository, ensure that the following access is configured.

If the repo is in your personal GitHub account
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.

If the repo is in someone else's personal GitHub account
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.
You must be added as a collaborator in the repository's settings under "Collaborators". Accept the invitation to be a collaborator using the link that is emailed to you.
If the repo is in a GitHub organization that you own
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.
You must be added as a collaborator, or your team must be added, in the repository's settings under "Collaborators and teams".
If the repo is in a GitHub organization that someone else owns
The PAT must have the required access scopes under Personal access tokens: repo, admin:repo_hook, read:user, and user:email.
You must be added as a collaborator, or your team must be added, in the repository's settings under "Collaborators and teams". Accept the invitation to be a collaborator using the link that is emailed to you.

This issue hasn't been updated in more than 180 days, so we've closed it. If you feel the issue is still relevant and needs fixed, please reopen it and we'll take another look. We appreciate your feedback and apologize for any inconvenience.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

o-o00o-o picture o-o00o-o  Â·  3Comments

cijujoseph picture cijujoseph  Â·  3Comments

sevaa picture sevaa  Â·  3Comments

anlatsko picture anlatsko  Â·  3Comments

letmaik picture letmaik  Â·  3Comments