File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1
1
CHANGELOG
2
2
=====================================
3
+ | September 20, 2021 : fix: Check that getRouter is defined before attempting to access it `#587 <https://github.com/mergeability/mergeable/pull/587>`_
3
4
| August 26, 2021 : fix: Await GithubAPI topics response `#585 <https://github.com/mergeability/mergeable/pull/585>`_
4
5
| August 10, 2021 : feat: New labels API `#577 <https://github.com/mergeability/mergeable/pull/577>`_
5
6
| August 6, 2021 : feat: Add team assignment to request_review action `#574 <https://github.com/mergeability/mergeable/pull/574>`_
Original file line number Diff line number Diff line change @@ -4,16 +4,18 @@ const githubRateLimitEndpoint = require('./lib/utils/githubRateLimitEndpoint')
4
4
const prometheusMiddleware = require ( 'express-prometheus-middleware' )
5
5
6
6
module . exports = ( robot , { getRouter } ) => {
7
- const router = getRouter ( )
7
+ if ( getRouter !== undefined ) {
8
+ const router = getRouter ( )
8
9
9
- if ( process . env . ENABLE_GITHUB_RATELIMIT_ENDPOINT === 'true' ) {
10
- // endpoint to fetch github given installation rate limit
11
- router . get ( '/github-ratelimit/:installationId' , githubRateLimitEndpoint ( robot ) )
12
- }
10
+ if ( process . env . ENABLE_GITHUB_RATELIMIT_ENDPOINT === 'true' ) {
11
+ // endpoint to fetch github given installation rate limit
12
+ router . get ( '/github-ratelimit/:installationId' , githubRateLimitEndpoint ( robot ) )
13
+ }
13
14
14
- if ( process . env . ENABLE_METRICS_ENDPOINT === 'true' ) {
15
- // expose prometheus metrics
16
- router . use ( prometheusMiddleware ( ) )
15
+ if ( process . env . ENABLE_METRICS_ENDPOINT === 'true' ) {
16
+ // expose prometheus metrics
17
+ router . use ( prometheusMiddleware ( ) )
18
+ }
17
19
}
18
20
19
21
logger . init ( robot . log )
You can’t perform that action at this time.
0 commit comments