You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are at least 4 different files where this method could DRY things up,
so let's extract it.
I've chosen to move it to src/helpers.ts but happy to be told there's a better
place for shared utility methods like this one.
constpopupMessage=`Successfully scheduled runs on ${pluralizeRepositories(numRepositoriesQueried)}. [Click here to see the progress](https://github.com/${owner}/${repo}/actions/runs/${response.workflow_run_id}).`
361
+
constpopupMessage=`Successfully scheduled runs on ${pluralize(numRepositoriesQueried,'repository','repositories')}. [Click here to see the progress](https://github.com/${owner}/${repo}/actions/runs/${response.workflow_run_id}).`
368
362
+(response.errors ? `${eol2}Some repositories could not be scheduled. See extension log for details.` : '');
369
363
370
-
letlogMessage=`Successfully scheduled runs on ${pluralizeRepositories(numRepositoriesQueried)}. See https://github.com/${owner}/${repo}/actions/runs/${response.workflow_run_id}.`;
364
+
letlogMessage=`Successfully scheduled runs on ${pluralize(numRepositoriesQueried,'repository','repositories')}. See https://github.com/${owner}/${repo}/actions/runs/${response.workflow_run_id}.`;
logMessage+=`${eol2}Some repositories could not be scheduled.`;
375
369
if(invalid_repositories?.length){
376
-
logMessage+=`${eol2}${pluralizeRepositories(invalid_repositories.length)} invalid and could not be found:${eol}${invalid_repositories.join(', ')}`;
370
+
logMessage+=`${eol2}${pluralize(invalid_repositories.length,'repository','repositories')} invalid and could not be found:${eol}${invalid_repositories.join(', ')}`;
377
371
}
378
372
if(repositories_without_database?.length){
379
-
logMessage+=`${eol2}${pluralizeRepositories(repositories_without_database.length)} did not have a CodeQL database available:${eol}${repositories_without_database.join(', ')}`;
373
+
logMessage+=`${eol2}${pluralize(repositories_without_database.length,'repository','repositories')} did not have a CodeQL database available:${eol}${repositories_without_database.join(', ')}`;
380
374
logMessage+=`${eol}For each public repository that has not yet been added to the database service, we will try to create a database next time the store is updated.`;
381
375
}
382
376
if(private_repositories?.length){
383
-
logMessage+=`${eol2}${pluralizeRepositories(private_repositories.length)} not public:${eol}${private_repositories.join(', ')}`;
377
+
logMessage+=`${eol2}${pluralize(private_repositories.length,'repository','repositories')} not public:${eol}${private_repositories.join(', ')}`;
384
378
logMessage+=`${eol}When using a public controller repository, only public repositories can be queried.`;
385
379
}
386
380
if(cutoff_repositories_count){
387
-
logMessage+=`${eol2}${pluralizeRepositories(cutoff_repositories_count)} over the limit for a single request`;
381
+
logMessage+=`${eol2}${pluralize(cutoff_repositories_count,'repository','repositories')} over the limit for a single request`;
0 commit comments