-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add missing noop param for full-sync
- Loading branch information
Showing
3 changed files
with
25 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
const { createProbot } = require('probot') | ||
const appFn = require('./') | ||
const { FULL_SYNC_NOOP } = require('./lib/env') | ||
const { createProbot } = require('probot') | ||
|
||
async function performFullSync (appFn, noop) { | ||
const probot = createProbot() | ||
probot.log.info(`Starting full sync with NOOP=${noop}`) | ||
|
||
const probot = createProbot() | ||
probot.log.info('Starting full sync.') | ||
const app = appFn(probot, {}) | ||
app.syncInstallation() | ||
.then(settings => { | ||
if (settings.errors.length > 0) { | ||
try { | ||
const app = appFn(probot, {}) | ||
const settings = await app.syncInstallation(noop) | ||
|
||
if (settings.errors && settings.errors.length > 0) { | ||
probot.log.error('Errors occurred during full sync.') | ||
process.exit(1) | ||
} else { | ||
probot.log.info('Done with full sync.') | ||
} | ||
}) | ||
.catch(error => { | ||
|
||
probot.log.info('Full sync completed successfully.') | ||
} catch (error) { | ||
process.stdout.write(`Unexpected error during full sync: ${error}\n`) | ||
process.exit(1) | ||
}) | ||
} | ||
} | ||
|
||
performFullSync(appFn, FULL_SYNC_NOOP).catch((error) => { | ||
console.error('Fatal error during full sync:', error) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters