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

Check if the users has access to repos? #84

Open
leet4tari opened this issue Mar 8, 2023 · 1 comment
Open

Check if the users has access to repos? #84

leet4tari opened this issue Mar 8, 2023 · 1 comment

Comments

@leet4tari
Copy link
Contributor

leet4tari commented Mar 8, 2023

On start up, might be worth checking the bot-user repo list - https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-repositories-for-the-authenticated-user.

Might also double as auth check and warning could be logged.

Would be useful as start of troubleshooting.

curl -H 'Authorization: Bearer token' https://api.github.com/user/repos

@leet4tari
Copy link
Contributor Author

leet4tari commented Mar 8, 2023

403 error would be token not setup - https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.

{
  "message": "Bad credentials",
  "documentation_url": "https://docs.github.com/rest"
}

Empty would mean perms not setup - https://docs.github.com/en/rest/overview/permissions-required-for-fine-grained-personal-access-tokens?apiVersion=2022-11-28.

[

]

Also using the list, so that the service does not try and spam the GitHub API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants