GitHub Probot:ERROR probot:签名与事件有效负载和密钥不匹配

时间:2018-03-29 04:03:40

标签: github github-api probot

我正在尝试使用Probot Framework构建GitHub应用。

以下是文件export default { name: 'request-tracking-calendar', data: { events: [ { id: 10, name: 'Boris', ssn: '515860000', }, { id: 11, name: 'Natasha', ssn: '575860001', }, ] }, created: function(){ console.log('Updating events dynamically..'); { //code omitted for clarity var xhr = new XMLHttpRequest(); // etc. xhr.onload = function(a) { if (xhr.status === 200) { for (var i in xhr.response.data){ //DOESN'T work! not a function console.log(this.convertJSONToEvent(xhr.response.data[i])); } console.log(this.events); //DOESN'T work } }; xhr.send(); } }, methods: { convertJSONToEvent(o){ //do something to o.. console.log('o was modified'); return o; }, 的内容:

index.js

但是,当我运行此应用程序时,在将其安装到存储库后,我收到此错误:

module.exports = (robot) => {
  robot.log('Yay, the app was loaded!');
  robot.on('*', async context => {
    robot.log('Some event occured!');
  });
}

此错误背后的问题是什么?我该如何解决这个问题?

1 个答案:

答案 0 :(得分:3)

它说,03:38:34.831Z ERROR probot: signature does not match event payload and secret Error: signature does not match event payload and secret at verifyAndReceive (/mnt/e/GSoC/test/test/node_modules/@octokit/webhooks/middleware/verify-and-receive.js:9:19) at IncomingMessage.request.on (/mnt/e/GSoC/test/test/node_modules/@octokit/webhooks/middleware/middleware.js:53:5) at emitNone (events.js:106:13) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickDomainCallback (internal/process/next_tick.js:218:9)

这背后的可能原因是存储库的signature does not match event payload and secret文件中的WEBHOOK_SECRET.env中的Webhook secret (optional)不匹配 https://github.com/settings/apps/your-app-name

正确配置webhook secret将解决此错误。

enter image description here