1+ const { activeOrg } = require ( './org' )
2+
13module . exports = async ( context , req ) => {
24 const command = req . body . comment . body
35 const owner = req . body . repository . owner . login
@@ -50,7 +52,7 @@ module.exports = async (context, req) => {
5052
5153 try {
5254 if ( command === '/open pr' ) {
53- if ( owner !== 'git-for-windows' || ! [ 'git' , 'msys2-runtime' ] . includes ( repo ) ) return `Ignoring ${ command } in unexpected repo: ${ commentURL } `
55+ if ( owner !== activeOrg || ! [ 'git' , 'msys2-runtime' ] . includes ( repo ) ) return `Ignoring ${ command } in unexpected repo: ${ commentURL } `
5456
5557 await checkPermissions ( )
5658
@@ -68,7 +70,7 @@ module.exports = async (context, req) => {
6870 const openPR = async ( package_name , packageType ) => {
6971 const { searchIssues } = require ( './search' )
7072 const prTitle = `${ package_name } : update to ${ version } `
71- const items = await searchIssues ( context , `org:git-for-windows is:pull-request "${ prTitle } " in:title` )
73+ const items = await searchIssues ( context , `org:${ activeOrg } is:pull-request "${ prTitle } " in:title` )
7274 const alreadyOpenedPR = items . filter ( e => e . title === prTitle )
7375
7476 const { appendToIssueComment } = require ( './issues' ) ;
@@ -91,7 +93,7 @@ module.exports = async (context, req) => {
9193 const answer = await triggerWorkflowDispatch (
9294 context ,
9395 await getToken ( ) ,
94- 'git-for-windows' ,
96+ activeOrg ,
9597 'git-for-windows-automation' ,
9698 'open-pr.yml' ,
9799 'main' , {
@@ -112,7 +114,7 @@ module.exports = async (context, req) => {
112114 }
113115
114116 if ( command === '/updpkgsums' ) {
115- if ( owner !== 'git-for-windows'
117+ if ( owner !== activeOrg
116118 || ! req . body . issue . pull_request
117119 || ! [ 'build-extra' , 'MINGW-packages' , 'MSYS2-packages' ] . includes ( repo ) ) {
118120 return `Ignoring ${ command } in unexpected repo: ${ commentURL } `
@@ -125,7 +127,7 @@ module.exports = async (context, req) => {
125127 const answer = await triggerWorkflowDispatch (
126128 context ,
127129 await getToken ( ) ,
128- 'git-for-windows' ,
130+ activeOrg ,
129131 'git-for-windows-automation' ,
130132 'updpkgsums.yml' ,
131133 'main' , {
@@ -142,7 +144,7 @@ module.exports = async (context, req) => {
142144
143145 const deployMatch = command . match ( / ^ \/ d e p l o y ( \s + ( \S + ) \s * ) ? $ / )
144146 if ( deployMatch ) {
145- if ( owner !== 'git-for-windows'
147+ if ( owner !== activeOrg
146148 || ! req . body . issue . pull_request
147149 || ! [ 'build-extra' , 'MINGW-packages' , 'MSYS2-packages' ] . includes ( repo ) ) {
148150 return `Ignoring ${ command } in unexpected repo: ${ commentURL } `
@@ -169,7 +171,7 @@ module.exports = async (context, req) => {
169171 await triggerWorkflowDispatch (
170172 context ,
171173 await getToken ( ) ,
172- 'git-for-windows' ,
174+ activeOrg ,
173175 'git-for-windows-automation' ,
174176 'build-and-deploy.yml' ,
175177 'main' , {
@@ -223,7 +225,7 @@ module.exports = async (context, req) => {
223225 e . id = await queueCheckRun (
224226 context ,
225227 await getToken ( ) ,
226- 'git-for-windows' ,
228+ activeOrg ,
227229 repo ,
228230 ref ,
229231 deployLabel ,
@@ -254,7 +256,7 @@ module.exports = async (context, req) => {
254256 await updateCheckRun (
255257 context ,
256258 await getToken ( ) ,
257- 'git-for-windows' ,
259+ activeOrg ,
258260 repo ,
259261 e . id , {
260262 details_url : e . answer . html_url
@@ -266,7 +268,7 @@ module.exports = async (context, req) => {
266268 }
267269
268270 if ( command === '/git-artifacts' ) {
269- if ( owner !== 'git-for-windows'
271+ if ( owner !== activeOrg
270272 || repo !== 'git'
271273 || ! req . body . issue . pull_request
272274 ) {
@@ -327,7 +329,7 @@ module.exports = async (context, req) => {
327329 const answer = await triggerWorkflowDispatch (
328330 context ,
329331 await getToken ( ) ,
330- 'git-for-windows' ,
332+ activeOrg ,
331333 'git-for-windows-automation' ,
332334 'tag-git.yml' ,
333335 'main' , {
@@ -389,7 +391,7 @@ module.exports = async (context, req) => {
389391 const releaseCheckRunId = await queueCheckRun (
390392 context ,
391393 await getToken ( ) ,
392- 'git-for-windows' ,
394+ activeOrg ,
393395 repo ,
394396 commitSHA ,
395397 'github-release' ,
@@ -425,7 +427,7 @@ module.exports = async (context, req) => {
425427 const owner = match [ 1 ]
426428 const repo = match [ 2 ]
427429 workFlowRunIDs [ architecture ] = match [ 3 ]
428- if ( owner !== 'git-for-windows' || repo !== 'git-for-windows-automation' ) {
430+ if ( owner !== activeOrg || repo !== 'git-for-windows-automation' ) {
429431 throw new Error ( `Unexpected repository ${ owner } /${ repo } for git-artifacts run ${ latest . id } : ${ latest . url } ` )
430432 }
431433
@@ -457,7 +459,7 @@ module.exports = async (context, req) => {
457459 const answer = await triggerWorkflowDispatch (
458460 context ,
459461 await getToken ( ) ,
460- 'git-for-windows' ,
462+ activeOrg ,
461463 'git-for-windows-automation' ,
462464 'release-git.yml' ,
463465 'main' , {
@@ -492,7 +494,7 @@ module.exports = async (context, req) => {
492494
493495 const relNotesMatch = command . match ( / ^ \/ a d d ( r e l n o t e | r e l e a s e ? n o t e ) ( \s + ( b l u r b | f e a t u r e | b u g ) \s + ( [ ^ ] * ) ) ? $ / i)
494496 if ( relNotesMatch ) {
495- if ( owner !== 'git-for-windows'
497+ if ( owner !== activeOrg
496498 || ! [ 'git' , 'build-extra' , 'MINGW-packages' , 'MSYS2-packages' ] . includes ( repo ) ) {
497499 return `Ignoring ${ command } in unexpected repo: ${ commentURL } `
498500 }
@@ -519,7 +521,7 @@ module.exports = async (context, req) => {
519521 const answer = await triggerWorkflowDispatch (
520522 context ,
521523 await getToken ( ) ,
522- 'git-for-windows' ,
524+ activeOrg ,
523525 'build-extra' ,
524526 'add-release-note.yml' ,
525527 'main' , {
0 commit comments