@@ -13,7 +13,7 @@ let deploymentConfig
1313module . exports = ( robot , { getRouter } , Settings = require ( './lib/settings' ) ) => {
1414 let appName = 'safe-settings'
1515 let appSlug = 'safe-settings'
16- async function syncAllSettings ( nop , context , repo = context . repo ( ) , ref ) {
16+ async function syncAllSettings ( nop , context , repo = context . repo ( ) , ref ) {
1717 try {
1818 deploymentConfig = await loadYamlFileSystem ( )
1919 robot . log . debug ( `deploymentConfig is ${ JSON . stringify ( deploymentConfig ) } ` )
@@ -42,7 +42,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
4242 }
4343 }
4444
45- async function syncSubOrgSettings ( nop , context , suborg , repo = context . repo ( ) , ref ) {
45+ async function syncSubOrgSettings ( nop , context , suborg , repo = context . repo ( ) , ref ) {
4646 try {
4747 deploymentConfig = await loadYamlFileSystem ( )
4848 robot . log . debug ( `deploymentConfig is ${ JSON . stringify ( deploymentConfig ) } ` )
@@ -67,7 +67,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
6767 }
6868 }
6969
70- async function syncSettings ( nop , context , repo = context . repo ( ) , ref ) {
70+ async function syncSettings ( nop , context , repo = context . repo ( ) , ref ) {
7171 try {
7272 deploymentConfig = await loadYamlFileSystem ( )
7373 robot . log . debug ( `deploymentConfig is ${ JSON . stringify ( deploymentConfig ) } ` )
@@ -92,7 +92,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
9292 }
9393 }
9494
95- async function renameSync ( nop , context , repo = context . repo ( ) , rename , ref ) {
95+ async function renameSync ( nop , context , repo = context . repo ( ) , rename , ref ) {
9696 try {
9797 deploymentConfig = await loadYamlFileSystem ( )
9898 robot . log . debug ( `deploymentConfig is ${ JSON . stringify ( deploymentConfig ) } ` )
@@ -101,7 +101,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
101101 const config = Object . assign ( { } , deploymentConfig , runtimeConfig )
102102 const renameConfig = Object . assign ( { } , config , rename )
103103 robot . log . debug ( `config for ref ${ ref } is ${ JSON . stringify ( config ) } ` )
104- return Settings . sync ( nop , context , repo , renameConfig , ref )
104+ return Settings . sync ( nop , context , repo , renameConfig , ref )
105105 } catch ( e ) {
106106 if ( nop ) {
107107 let filename = env . SETTINGS_FILE_PATH
@@ -123,7 +123,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
123123 *
124124 * @return The parsed YAML file
125125 */
126- async function loadYamlFileSystem ( ) {
126+ async function loadYamlFileSystem ( ) {
127127 if ( deploymentConfig === undefined ) {
128128 const deploymentConfigPath = env . DEPLOYMENT_CONFIG_FILE
129129 if ( fs . existsSync ( deploymentConfigPath ) ) {
@@ -135,7 +135,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
135135 return deploymentConfig
136136 }
137137
138- function getAllChangedSubOrgConfigs ( payload ) {
138+ function getAllChangedSubOrgConfigs ( payload ) {
139139 const settingPattern = new Glob ( `${ env . CONFIG_PATH } /suborgs/*.yml` )
140140 // Changes will be an array of files that were added
141141 const added = payload . commits . map ( c => {
@@ -159,7 +159,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
159159 return configs
160160 }
161161
162- function getAllChangedRepoConfigs ( payload , owner ) {
162+ function getAllChangedRepoConfigs ( payload , owner ) {
163163 const settingPattern = new Glob ( `${ env . CONFIG_PATH } /repos/*.yml` )
164164 // Changes will be an array of files that were added
165165 const added = payload . commits . map ( c => {
@@ -182,7 +182,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
182182 return configs
183183 }
184184
185- function getChangedRepoConfigName ( glob , files , owner ) {
185+ function getChangedRepoConfigName ( glob , files , owner ) {
186186 const modifiedFiles = files . filter ( s => {
187187 robot . log . debug ( JSON . stringify ( s ) )
188188 return ( s . search ( glob ) >= 0 )
@@ -193,7 +193,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
193193 } )
194194 }
195195
196- function getChangedSubOrgConfigName ( glob , files ) {
196+ function getChangedSubOrgConfigName ( glob , files ) {
197197 const modifiedFiles = files . filter ( s => {
198198 robot . log . debug ( JSON . stringify ( s ) )
199199 return ( s . search ( glob ) >= 0 )
@@ -205,7 +205,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
205205 } )
206206 }
207207
208- async function createCheckRun ( context , pull_request , head_sha , head_branch ) {
208+ async function createCheckRun ( context , pull_request , head_sha , head_branch ) {
209209 const { payload } = context
210210 // robot.log.debug(`Check suite was requested! for ${context.repo()} ${pull_request.number} ${head_sha} ${head_branch}`)
211211 const res = await context . octokit . checks . create ( {
@@ -234,7 +234,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
234234 }
235235
236236
237- async function syncInstallation ( ) {
237+ async function syncInstallation ( ) {
238238 robot . log . trace ( 'Fetching installations' )
239239 const github = await robot . auth ( )
240240
@@ -395,7 +395,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
395395 } )
396396
397397 robot . on ( 'repository.renamed' , async context => {
398- if ( env . BLOCK_REPO_RENAME_BY_HUMAN !== 'true' ) {
398+ if ( env . BLOCK_REPO_RENAME_BY_HUMAN !== 'true' ) {
399399 robot . log . debug ( `"env.BLOCK_REPO_RENAME_BY_HUMAN" is 'false' by default. Repo rename is not managed by Safe-settings. Continue with the default behavior.` )
400400 return
401401 }
@@ -414,7 +414,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
414414 const newPath = `.github/repos/${ payload . repository . name } .yml`
415415 robot . log . debug ( oldPath )
416416 try {
417- const repofile = await context . octokit . request ( 'GET /repos/{owner}/{repo}/contents/{path}' , {
417+ const repofile = await context . octokit . request ( 'GET /repos/{owner}/{repo}/contents/{path}' , {
418418 owner : payload . repository . owner . login ,
419419 repo : env . ADMIN_REPO ,
420420 path : oldPath ,
@@ -443,7 +443,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
443443 owner : payload . repository . owner . login ,
444444 repo : env . ADMIN_REPO ,
445445 path : newPath ,
446- name : `${ payload . repository . name } .yml` ,
446+ name : `${ payload . repository . name } .yml` ,
447447 content : content ,
448448 message : `Repo Renamed and safe-settings renamed the file from ${ payload . changes . repository . name . from } to ${ payload . repository . name } ` ,
449449 sha : repofile . data . sha ,
@@ -455,21 +455,21 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
455455 } else {
456456 robot . log . error ( error )
457457 }
458- }
458+ }
459459
460460 } catch ( error ) {
461461 if ( error . status === 404 ) {
462462 //nop
463- } else {
463+ } else {
464464 robot . log . error ( error )
465465 }
466- }
466+ }
467467 return
468468 } else {
469469 robot . log . debug ( 'Repository Edited by a Human' )
470470 // Create a repository config to reset the name back to the previous name
471- const rename = { repository : { name : payload . changes . repository . name . from , oldname : payload . repository . name } }
472- const repo = { repo : payload . changes . repository . name . from , owner : payload . repository . owner . login }
471+ const rename = { repository : { name : payload . changes . repository . name . from , oldname : payload . repository . name } }
472+ const repo = { repo : payload . changes . repository . name . from , owner : payload . repository . owner . login }
473473 return renameSync ( false , context , repo , rename )
474474 }
475475 } )
@@ -663,7 +663,7 @@ module.exports = (robot, { getRouter }, Settings = require('./lib/settings')) =>
663663 syncInstallation ( )
664664 } )
665665 }
666-
666+
667667 // Get info about the app
668668 info ( )
669669
0 commit comments