Deprecation: [@octokit/rest] "number" parameter is deprecated for ".issues.createComment()". Use "issue_number" instead
See original GitHub issueBug Report
Current Behavior I’m currently getting this deprecation error with probot v9.2.6.
This is the code path:
probotApp.app = function app(probotRouter) {
probotRouter.on("issue_comment.created", commentAdded);
};
async function commentAdded(context) {
if (context.payload.sender.type === "Bot") {
return;
}
const issueComment = context.issue({body: "Thanks for adding a comment!"});
return context.github.issues.createComment(issueComment);
}
Deprecation: [@octokit/rest] “number” parameter is deprecated for “.issues.createComment()”. Use “issue_number” instead at Object.keys.forEach.key (/app/node_modules/probot/node_modules/@octokit/rest/plugins/register-endpoints/register-endpoints.js:73:26) at Array.forEach (<anonymous>) at Object.patchedMethod [as createComment] (/app/node_modules/probot/node_modules/@octokit/rest/plugins/register-endpoints/register-endpoints.js:69:26) at commentAdded (/app/src/probot-app.js:117:32) at Application.<anonymous> (/app/node_modules/probot/lib/application.js:153:50) at step (/app/node_modules/probot/lib/application.js:43:23) at Object.next (/app/node_modules/probot/lib/application.js:24:53) at fulfilled (/app/node_modules/probot/lib/application.js:15:58)
Expected behavior/code I expect no deprecation errors
Environment
- Probot version(s): v9.2.6
- Node/npm version: node 10.15.3 / npm v6.4.1
- OS: alpine linux (in docker container
node:10-alpine
)
Additional context/Screenshots
I’m also having an issue with this code where the bot’s issue comment is being created 4 times even though the createComment()
method is only called once. But I’m not sure if these two issues are related.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13 (6 by maintainers)
Top GitHub Comments
It cannot be fixed without a breaking change, so we hold back until v10
This is just a deprecation warning, not an Error. It should not affect your app