Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum scopes needed for personal access token #10

Closed
hugovk opened this issue Sep 20, 2019 · 15 comments
Closed

Minimum scopes needed for personal access token #10

hugovk opened this issue Sep 20, 2019 · 15 comments

Comments

@hugovk
Copy link
Contributor

hugovk commented Sep 20, 2019

When creating a personal access token for https://github.com/alex-page/github-project-automation-plus#private-repositories, what are the minimum scopes needed?

Are they different for a private repo or one you don't have admin access to?

Thanks!

@alex-page
Copy link
Owner

alex-page commented Sep 20, 2019

Thanks for opening this @hugovk. I will leave this issue open for now and add this content to the README.md file.

For an organization with private repositories you will need admin:org:

  • Read and write org and team membership, read and write org projects

For private repositories you need repo:

  • Grants full access to private and public repositories. That includes read/write access to code, commit statuses, repository and organization projects, invitations, collaborators, adding team memberships, and deployment statuses for public and private repositories and organizations. Also grants ability to manage user projects.

@hugovk
Copy link
Contributor Author

hugovk commented Sep 20, 2019

Thank you, is the first bullet for orgs with public repos where you don't have admin access?

@alex-page
Copy link
Owner

alex-page commented Sep 20, 2019

Oh you might have trouble connecting issues from public repos without access. If you could do it I would assume the admin:org settings. Let me know though as I haven't tested it.

@hugovk
Copy link
Contributor Author

hugovk commented Sep 22, 2019

We've tried with repo and admin permissions on a public repo, but we get "bad credentials". Any ideas?

python-pillow/Pillow#4078

@aclark4life, who created the personal access token, has admin access to the repo. @radarhere and me, who have created PRs that get the error, do not have admin access.

@hugovk
Copy link
Contributor Author

hugovk commented Sep 23, 2019

Tested with a private repo: works with just the repo scope.

@alex-page
Copy link
Owner

@hugovk is this working now or still an issue with public repos without admin access?

@hugovk
Copy link
Contributor Author

hugovk commented Sep 23, 2019

It's still an issue for public repos without admin access. (Working for private repos.)

@alex-page
Copy link
Owner

Ok I will try and have a look into this. Thank you @hugovk.

@hugovk
Copy link
Contributor Author

hugovk commented Sep 23, 2019

Thanks, let me know if I help out by creating PRs on a test repo.

@alex-page
Copy link
Owner

@hugovk can you try again with v0.1.0. I just merged a pull request that changes what projects it searches. If this doesn't work can you paste your error message here?

@hugovk
Copy link
Contributor Author

hugovk commented Sep 24, 2019

Here's a PR with v0.1.0: python-pillow/Pillow#4085

The log:

Run alex-page/github-project-automation-plus@v0.1.0
  with:
    project: Pillow
    column: New Issues
 ##[error]HttpError: Bad credentials
##[error]Bad credentials
##[error]Node run failed with exit code 1

https://github.com/python-pillow/Pillow/pull/4085/checks?check_run_id=233656551

@aclark4life
Copy link

@hugovk @alex-page I noticed the GH_PAT in my personal tokens hadn't been used yet, so I removed it. Let me know if I should recreate … thanks for working on this.

@hugovk
Copy link
Contributor Author

hugovk commented Sep 24, 2019

Aha, so repo secrets are not available to forks at all, that explains why it hadn't been used.

See, for example:

@alex-page
Copy link
Owner

Oh that is frustrating. I assume that is a limitation of GitHub. Is there anything I can do with this project to help?

@hugovk
Copy link
Contributor Author

hugovk commented Sep 24, 2019

Yeah, looks like a GitHub limitation. From another Action project: maxheld83/ghactions#262 (comment)

I guess the best this project can do is mention it's not currently possible. Hopefully GH will make it possible in the future!

Thanks for looking into this!

@hugovk hugovk closed this as completed Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants