-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
26 lines (24 loc) · 677 Bytes
/
Copy pathapp.js
File metadata and controls
26 lines (24 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const app = require('express')()
const ghsync = require('./github-sync.js')
var port = 3000
var config = JSON.parse(process.env.config)
var configJson = {
github_pat: config.github_pat,
sources_global_github_pat : ("sources_global_github_pat" in config) ? config.sources_global_github_pat : config.github_pat,
target_repo: config.target_repo,
source_repos: config.source_repos
}
/**
* Main method.
*/
async function ghSync(config) {
const promise = ghsync(configJson)
promise
.then(function(response) {
console.log("INFO: Sync complete.")
})
.catch(function(response) {
console.log("ERROR: Sync failed.")
})
}
ghSync(config)