-
Notifications
You must be signed in to change notification settings - Fork 56
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
[BUG]: No way to add new methods to octokit.rest.repos in v7 #668
Comments
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with |
the correct way to define methods is to export an object where the keys are the methods that should be added to You cannot rely on |
If I want to add a method to module.exports = function (octokit) {
return {
rest: {
repos: {
...octokit.rest.repos,
createOrUpdateFiles: plugin.bind(null, octokit),
},
},
};
}; This has the same error:
Or is the recommendation not to attach at that point, and to make |
I'm sorry but the best answer I have is you shouldn't, as I explained above. Plugins should declare top level methods, in your case it would be |
Thanks for the info. I've moved the method to the object root in the plugin |
Thank you! I'll make sure to add note to plugin docs |
…ctokit` instance addresses octokit/plugin-rest-endpoint-methods.js#668
…ctokit` instance (#605) addresses octokit/plugin-rest-endpoint-methods.js#668
What happened?
I maintain octokit-commit-multiple-files, which has stopped working with
plugin-rest-endpoint-methods.js
7.0. (Bug report: mheap/octokit-commit-multiple-files#110)It seems to be related to the refactoring in #622
I previously attached a new method to
octokit.rest.repos
like so:Is there a way to register new methods after this refactoring?
Versions
@octokit/rest 19.0.7
Node.js v18.15.0
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: