Skip to content

Commit 47671ab

Browse files
committed
Track collections
1 parent 96e6b65 commit 47671ab

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pr-checks/sync.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ function main(): void {
145145

146146
console.log(`Found ${checkFiles.length} check specification(s).`);
147147

148+
const collections: Record<
149+
string,
150+
Array<{
151+
specification: Specification;
152+
checkName: string;
153+
inputs: Record<string, WorkflowInput>;
154+
}>
155+
> = {};
156+
148157
for (const file of checkFiles) {
149158
const checkName = path.basename(file, ".yml");
150159
const checkSpecification = loadYaml(file);
@@ -387,6 +396,19 @@ function main(): void {
387396
checkJob.env.CODEQL_ACTION_TEST_MODE = true;
388397
}
389398

399+
// If this check belongs to a named collection, record it.
400+
if (checkSpecification.collection) {
401+
const collectionName = checkSpecification.collection;
402+
if (!collections[collectionName]) {
403+
collections[collectionName] = [];
404+
}
405+
collections[collectionName].push({
406+
specification: checkSpecification,
407+
checkName,
408+
inputs: workflowInputs,
409+
});
410+
}
411+
390412
let extraGroupName = "";
391413
for (const inputName of Object.keys(workflowInputs)) {
392414
extraGroupName += "-${{inputs." + inputName + "}}";

0 commit comments

Comments
 (0)