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

use_github() - allow repo creation when repo is a redirect #1894

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

ateucher
Copy link
Collaborator

@ateucher ateucher commented Sep 6, 2023

This changes check_no_github_repo() to check the name of the response from the GitHub API against the provided spec (user/repo) - If they are different it assumes it's a redirect and then proceeds and allows repo creation. It retains the behaviour where if request to the GitHub API returns a 404 it similarly passes and allows the creation of the new repo.

Unfortunately the response returned from the GitHub API doesn't appear to explicitly say it's been redirected (i.e., it's a 200 HTTP code, not a 301).

Fixes #1893.

I didn't add any tests - though could add to the manual tests if you like?

* Check name of repo against provided spec, if they are different assume it's a redirect and allow repo creation.
@ateucher ateucher changed the title Allow repo creation when repo is a redirect use_github() - allow repo creation when repo is a redirect Sep 6, 2023
@ateucher ateucher requested a review from jennybc September 6, 2023 21:16
@jennybc
Copy link
Member

jennybc commented Sep 15, 2023

Is this time sensitive, i.e. needed for conf?

@ateucher
Copy link
Collaborator Author

Nope! It was for my own prep, but I just used my local branch.

@jennybc
Copy link
Member

jennybc commented Jul 23, 2024

Thanks!

@jennybc jennybc merged commit ae2e744 into main Jul 23, 2024
12 checks passed
@jennybc jennybc deleted the use-github-renamed-repo branch July 23, 2024 19:01
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

Successfully merging this pull request may close these issues.

use_github() fails with "Repo already exists" after renaming a repo
2 participants