fix: use `webhooks.onError()` instead of deprecated `webhooks.on("error", ...)` (#1390)

This commit is contained in:
AJ Schmidt 2020-10-26 15:02:16 -04:00 committed by GitHub
parent 41ee70cbf1
commit a5b36b3344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 84 additions and 23 deletions

103
package-lock.json generated
View File

@ -53,16 +53,77 @@
}
},
"@babel/helper-create-class-features-plugin": {
"version": "7.10.5",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz",
"integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==",
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.1.tgz",
"integrity": "sha512-hkL++rWeta/OVOBTRJc9a5Azh5mt5WgZUGAKMD8JM141YsE08K//bp1unBBieO6rUKkIPyUE0USQ30jAy3Sk1w==",
"requires": {
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-member-expression-to-functions": "^7.10.5",
"@babel/helper-member-expression-to-functions": "^7.12.1",
"@babel/helper-optimise-call-expression": "^7.10.4",
"@babel/helper-plugin-utils": "^7.10.4",
"@babel/helper-replace-supers": "^7.10.4",
"@babel/helper-replace-supers": "^7.12.1",
"@babel/helper-split-export-declaration": "^7.10.4"
},
"dependencies": {
"@babel/generator": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.1.tgz",
"integrity": "sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg==",
"requires": {
"@babel/types": "^7.12.1",
"jsesc": "^2.5.1",
"source-map": "^0.5.0"
}
},
"@babel/helper-member-expression-to-functions": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.1.tgz",
"integrity": "sha512-k0CIe3tXUKTRSoEx1LQEPFU9vRQfqHtl+kf8eNnDqb4AUJEy5pz6aIiog+YWtVm2jpggjS1laH68bPsR+KWWPQ==",
"requires": {
"@babel/types": "^7.12.1"
}
},
"@babel/helper-replace-supers": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.1.tgz",
"integrity": "sha512-zJjTvtNJnCFsCXVi5rUInstLd/EIVNmIKA1Q9ynESmMBWPWd+7sdR+G4/wdu+Mppfep0XLyG2m7EBPvjCeFyrw==",
"requires": {
"@babel/helper-member-expression-to-functions": "^7.12.1",
"@babel/helper-optimise-call-expression": "^7.10.4",
"@babel/traverse": "^7.12.1",
"@babel/types": "^7.12.1"
}
},
"@babel/parser": {
"version": "7.12.3",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.3.tgz",
"integrity": "sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw=="
},
"@babel/traverse": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.1.tgz",
"integrity": "sha512-MA3WPoRt1ZHo2ZmoGKNqi20YnPt0B1S0GTZEPhhd+hw2KGUzBlHuVunj6K4sNuK+reEvyiPwtp0cpaqLzJDmAw==",
"requires": {
"@babel/code-frame": "^7.10.4",
"@babel/generator": "^7.12.1",
"@babel/helper-function-name": "^7.10.4",
"@babel/helper-split-export-declaration": "^7.11.0",
"@babel/parser": "^7.12.1",
"@babel/types": "^7.12.1",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.19"
}
},
"@babel/types": {
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.1.tgz",
"integrity": "sha512-BzSY3NJBKM4kyatSOWh3D/JJ2O3CVzBybHWxtgxnggaxEuaSTTDqeiSb/xk9lrkw2Tbqyivw5ZU4rT+EfznQsA==",
"requires": {
"@babel/helper-validator-identifier": "^7.10.4",
"lodash": "^4.17.19",
"to-fast-properties": "^2.0.0"
}
}
}
},
"@babel/helper-function-name": {
@ -291,30 +352,30 @@
}
},
"@babel/plugin-syntax-typescript": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz",
"integrity": "sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==",
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.12.1.tgz",
"integrity": "sha512-UZNEcCY+4Dp9yYRCAHrHDU+9ZXLYaY9MgBXSRLkB9WjYFRR6quJBumfVrEkUxrePPBwFcpWfNKXqVRQQtm7mMA==",
"requires": {
"@babel/helper-plugin-utils": "^7.10.4"
}
},
"@babel/plugin-transform-typescript": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.11.0.tgz",
"integrity": "sha512-edJsNzTtvb3MaXQwj8403B7mZoGu9ElDJQZOKjGUnvilquxBA3IQoEIOvkX/1O8xfAsnHS/oQhe2w/IXrr+w0w==",
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.12.1.tgz",
"integrity": "sha512-VrsBByqAIntM+EYMqSm59SiMEf7qkmI9dqMt6RbD/wlwueWmYcI0FFK5Fj47pP6DRZm+3teXjosKlwcZJ5lIMw==",
"requires": {
"@babel/helper-create-class-features-plugin": "^7.10.5",
"@babel/helper-create-class-features-plugin": "^7.12.1",
"@babel/helper-plugin-utils": "^7.10.4",
"@babel/plugin-syntax-typescript": "^7.10.4"
"@babel/plugin-syntax-typescript": "^7.12.1"
}
},
"@babel/preset-typescript": {
"version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz",
"integrity": "sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==",
"version": "7.12.1",
"resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.12.1.tgz",
"integrity": "sha512-hNK/DhmoJPsksdHuI/RVrcEws7GN5eamhi28JkO52MqIxU8Z0QpmiSOQxZHWOHV7I3P4UjHV97ay4TcamMA6Kw==",
"requires": {
"@babel/helper-plugin-utils": "^7.10.4",
"@babel/plugin-transform-typescript": "^7.10.4"
"@babel/plugin-transform-typescript": "^7.12.1"
}
},
"@babel/template": {
@ -1383,9 +1444,9 @@
}
},
"@octokit/webhooks": {
"version": "7.13.0",
"resolved": "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-7.13.0.tgz",
"integrity": "sha512-v+020Zf4kFmGnQS5I3pvzJM3g8tQncCJHczhKqCI5WB2p+kIbb3PnNxNsuQ62DGNHDcE1CLUpARLaDSvh5lCOA==",
"version": "7.15.0",
"resolved": "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-7.15.0.tgz",
"integrity": "sha512-B3GpvRSYaPUZv+X3npttozt20K8AKFaLOKJsmNkIotO1pgM/92ttGdl/ijjPou3M7znfT60+cj+YXphl0DLjcA==",
"requires": {
"@octokit/request-error": "^2.0.2",
"@pika/plugin-ts-standard-pkg": "^0.9.2",

View File

@ -47,7 +47,7 @@
"@octokit/plugin-throttling": "^3.3.0",
"@octokit/request": "^5.1.0",
"@octokit/types": "^5.0.1",
"@octokit/webhooks": "^7.13.0",
"@octokit/webhooks": "^7.15.0",
"@probot/octokit-plugin-config": "^1.0.0",
"@probot/pino": "^1.1.2",
"@types/express": "^4.17.2",

View File

@ -12,6 +12,6 @@ export function getWebhooks(state: State) {
secret: state.webhooks.secret,
transform: webhookTransform.bind(null, state),
});
webhooks.on("error", getErrorHandler(state.log));
webhooks.onError(getErrorHandler(state.log));
return webhooks;
}