Skip to content

Commit ba31fa9

Browse files
authored
chore: check if config exist before starting (#621)
Signed-off-by: Tomer Figenblat <[email protected]>
1 parent 884a15e commit ba31fa9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/app-runner.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export async function handler (event) {
1111
logLevel: process.env.LOG_LEVEL || 'info',
1212
});
1313

14+
probot.log.debug('loading app');
1415
await probot.load(autoMeBot);
16+
probot.log.debug('app loaded, starting webhook');
1517

1618
return probot.webhooks.verifyAndReceive({
1719
id: event.headers['x-github-delivery'],

src/auto-me-bot.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ export default function (probot) {
6161
export function handlersController(configSpec) {
6262
return async context => {
6363
// get config from current repo .github folder or from the .github repo's .github folder
64-
let config = await context.config('auto-me-bot.yml');
6564
context.log.debug(`Payload: ${JSON.stringify(context.payload)}`)
65+
let config = await context.config('auto-me-bot.yml');
66+
if (config == null) {
67+
context.log.info("no config found")
68+
return
69+
}
6670
context.log.debug(`Config: ${JSON.stringify(config)}`)
6771
let invocations = []
6872
let startedAt = new Date().toISOString();

0 commit comments

Comments
 (0)