If a user renames a repository from foo/bar.git
to foo/baz.git
via GitHub's UI, how can I detect this via the API?
Currently, I get a 404 if I call the API like this:
GET /repos/foo/bar
How can I find the new repository name?
So GitHub does not expose renames through the API.
UPDATE: that is no longer true and this answer is out of date; the API has exposed renames since July 2015.
Given the constraints of your question (i.e., just the repository name has changed, not the user/organization) you could rely on the repository ID.
If you have information about the repo before it was renamed, you should have the id which is returned by the API. If you do then to have a resilient access to the repository, you just need to do
GET /repositories/1234
And you'll always get the repository, regardless of whether the name changes (assuming you still have access to it).
A better example, is to do
GET https://api.github.com/repositories/1234
(or whatever your GitHub enterprise instance is).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments