@@ -252,14 +252,7 @@ export async function scaleUp(eventSource: string, payload: ActionRequestMessage
252
252
) ;
253
253
}
254
254
255
- if ( enableOrgLevel && payload . repoOwnerType !== 'Organization' ) {
256
- logger . warn ( `Repository ${ payload . repositoryOwner } /${ payload . repositoryName } does not belong to a GitHub` +
257
- `organization and organization runners are enabled. This is not supported. Not scaling up for this event.` ) ;
258
- throw Error (
259
- `Repository ${ payload . repositoryOwner } /${ payload . repositoryName } does not belong to a GitHub` +
260
- `organization and organization runners are enabled. This is not supported. Not scaling up for this event.` ,
261
- ) ;
262
- }
255
+ validateRepoOwnerTypeIfOrgLevelEnabled ( payload , enableOrgLevel ) ;
263
256
264
257
const ephemeral = ephemeralEnabled && payload . eventType === 'workflow_job' ;
265
258
const runnerType = enableOrgLevel ? 'Org' : 'Repo' ;
@@ -352,6 +345,18 @@ async function createStartRunnerConfig(
352
345
}
353
346
}
354
347
348
+ function validateRepoOwnerTypeIfOrgLevelEnabled ( payload : ActionRequestMessage , enableOrgLevel : boolean ) {
349
+ if ( enableOrgLevel && payload . repoOwnerType !== 'Organization' ) {
350
+ logger . warn ( `Repository ${ payload . repositoryOwner } /${ payload . repositoryName } does not belong to a GitHub` +
351
+ `organization and organization runners are enabled. This is not supported. Not scaling up for this event.` ) ;
352
+ throw Error (
353
+ `Repository ${ payload . repositoryOwner } /${ payload . repositoryName } does not belong to a GitHub` +
354
+ `organization and organization runners are enabled. This is not supported. Not scaling up for this event.` ,
355
+ ) ;
356
+ }
357
+
358
+ }
359
+
355
360
function addDelay ( instances : string [ ] ) {
356
361
const delay = async ( ms : number ) => new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ;
357
362
const ssmParameterStoreMaxThroughput = 40 ;
0 commit comments