-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Get repo by ID #163
Comments
Is there a reason why this Issue was closed ? I would love this feature as well + I also stumbled upon piotrmurach/github#283 (comment) |
Hi @Londane You can get a repository by ID using octokit.request('GET /repositories/:id', {id}) See the "BREAKING CHANGES" section for the v16 release. We removed a dedicated method because it’s not documented on https://developer.github.com/v3/ either. I think it’s being discussed to make it "official" as integrators depend on it, once it does, we will add a method again. If you want to add the previous method back, you can do it using a plugin const Octokit = require('@octokit/plugin')
.plugin((octokit) => {
octokit.registerEndpoints({
repos: {
getById: {
method: 'GET',
url: '/repositories/:id',
params: {
id: {
type: 'string',
required: true
}
}
}
}
})
})
const octokit = new Octokit()
octokit.repos.getById({id: 123}) |
Thank your very much for your help! |
@gr2m for what it's worth, I desperately needed |
The endpoint
/repositories/:id
is not documented on GitHub, but it is available.Example: https://api.github.com/repositories/20633049
Also PyGithub uses this (https://github.com/jacquev6/PyGithub/blob/b64b0d6942bb27095bd035b8c0db10ca35448be3/github/MainClass.py) and I would like to also have it for Node.js
We need this, because the
user/repo
is not a good identifier for a unique repo, since repo names can be changed, username can be changed and ownership can be moved.The text was updated successfully, but these errors were encountered: