mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Track collections
This commit is contained in:
@@ -145,6 +145,15 @@ function main(): void {
|
||||
|
||||
console.log(`Found ${checkFiles.length} check specification(s).`);
|
||||
|
||||
const collections: Record<
|
||||
string,
|
||||
Array<{
|
||||
specification: Specification;
|
||||
checkName: string;
|
||||
inputs: Record<string, WorkflowInput>;
|
||||
}>
|
||||
> = {};
|
||||
|
||||
for (const file of checkFiles) {
|
||||
const checkName = path.basename(file, ".yml");
|
||||
const checkSpecification = loadYaml(file);
|
||||
@@ -387,6 +396,19 @@ function main(): void {
|
||||
checkJob.env.CODEQL_ACTION_TEST_MODE = true;
|
||||
}
|
||||
|
||||
// If this check belongs to a named collection, record it.
|
||||
if (checkSpecification.collection) {
|
||||
const collectionName = checkSpecification.collection;
|
||||
if (!collections[collectionName]) {
|
||||
collections[collectionName] = [];
|
||||
}
|
||||
collections[collectionName].push({
|
||||
specification: checkSpecification,
|
||||
checkName,
|
||||
inputs: workflowInputs,
|
||||
});
|
||||
}
|
||||
|
||||
let extraGroupName = "";
|
||||
for (const inputName of Object.keys(workflowInputs)) {
|
||||
extraGroupName += "-${{inputs." + inputName + "}}";
|
||||
|
||||
Reference in New Issue
Block a user