测试npx probot-app;在每个启动程序中尝试,并且存在相同的问题。
我创建、构建和运行该应用程序,然后在github上配置和安装该应用程序,我能够接收web钩子事件,但我看到我的本地应用程序响应了404。
error: Error: cannot POST / (404)
ERROR (server): Not Found
Error: Not Found
at Request.callback (/Users/X/Projects/Y/compiler/githubapp/x-bot/node_modules/superagent/lib/node/index.js:884:15)
at IncomingMessage.<anonymous> (/Users/X/Projects/Y/compiler/githubapp/x-bot/node_modules/superagent/lib/node/index.js:1127:20)
at IncomingMessage.emit (events.js:326:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
status: 404我的index.ts:
export = (app: Probot) => {
app.on("issues.opened", async (context) => {
const issueComment = context.issue({
body: "Thanks for opening this issue!",
});
await context.octokit.issues.createComment(issueComment);
});
// For more information on building apps:
// https://probot.github.io/docs/
// To get your app running against GitHub, see:
// https://probot.github.io/docs/development/
};我检查了我的环境变量在.env中的正确设置
总之,github正在发送一个web钩子,smee正在接收它,但是我的本地应用程序是404:无法发布/
由于似乎是路由问题,无法获得示例应用程序来处理web钩子事件。以前有人遇到过这种事吗?
发布于 2022-01-03 22:12:53
确保您没有在端口3000上运行任何其他应用程序。默认使用3000,并可能导致您所描述的错误。
发布于 2021-12-24 19:14:59
其中一个可能的原因可能是您的GitHub应用程序没有采取该操作的权限。您的GitHub应用程序是否可能缺少“问题”特权设置?(https://docs.github.com/en/rest/reference/permissions-required-for-github-apps#permission-on-issues)
https://stackoverflow.com/questions/70467380
复制相似问题