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

potential bug? - github.remote_repo_exists returns false with bad token even if repo exists. #450

Open
lwasser opened this issue Nov 16, 2021 · 2 comments

Comments

@lwasser
Copy link

lwasser commented Nov 16, 2021

i'm addig this as a potential bug. I know that token="" When working with github.remote_repo exists. If you don't have a token or the token is BAD, it returns false even if the repo does exist.

Try this:
github.remote_repo_exists("earthlab", "earthpy", token="sdf")

i need to work on the test a bit more but right now if the token is bad it will return a false. what i don't know is if the bad token will always be caught before that check so i'm opening this knowing it may be addressed elsewhere but i don't see that yet. it is called once in template.py when we update the template repo.

@lwasser lwasser changed the title potential bug? - github.remote_repo_exists potential bug? - github.remote_repo_exists returns false with bad token even if repo exists. Nov 16, 2021
@kcranston
Copy link
Collaborator

kcranston commented Feb 3, 2022

When the repo doesn't exist, the API returns a 404, but when the token is bad it returns a 401. So, we can distinguish between the two.

@nkorinek
Copy link
Member

nkorinek commented Feb 3, 2022

Error for failed authentication here:
image

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