Skip to content

Commit

Permalink
Adding external runner for doing a one-time full-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dolan-a committed Oct 25, 2024
1 parent 777a97f commit 6163611
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions full-sync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { createProbot } = require('probot')
const appFn = require('./')

const probot = createProbot()
probot.log.info('Starting full sync.')
const app = appFn(probot, {})
app.syncInstallation()
.then(settings => {
if (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 => {
process.stdout.write(`Unexpected error during full sync: ${error}\n`)
process.exit(1)
})
1 change: 1 addition & 0 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Settings {
settings.logError(error.message)
await settings.handleResults()
}
return settings
}

static async syncSubOrgs (nop, context, suborg, repo, config, ref) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"scripts": {
"dev": "nodemon --inspect",
"start": "probot run ./index.js",
"full-sync": "node ./full-sync.js",
"test": "npm-run-all --print-label --parallel lint:* --parallel test:*",
"lint:es": "eslint .",
"lint:js": "standard",
Expand Down

0 comments on commit 6163611

Please sign in to comment.