Skip to content

Commit f37d008

Browse files
committed
Moves calls to pack download to the init action
This ensures all steps to gather queries happens in the init action. This is where checking out queries in other repos happens as well.
1 parent a59fbe2 commit f37d008

6 files changed

Lines changed: 32 additions & 26 deletions

File tree

lib/analyze.js

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/analyze.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/analyze.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -280,21 +280,6 @@ export async function runQueries(
280280
logger.endGroup();
281281
logger.info(analysisSummary);
282282
} else {
283-
if (hasPackWithCustomQueries) {
284-
logger.info("Performing analysis with custom CodeQL Packs.");
285-
logger.startGroup(`Downloading custom packs for ${language}`);
286-
287-
const results = await codeql.packDownload(packsWithVersion);
288-
289-
logger.info(
290-
`Downloaded packs: ${results.packs
291-
.map((r) => `${r.name}@${r.version || "latest"}`)
292-
.join(", ")}`
293-
);
294-
295-
logger.endGroup();
296-
}
297-
298283
logger.startGroup(`Running queries for ${language}`);
299284
const querySuitePaths: string[] = [];
300285
if (queries["builtin"].length > 0) {

src/config-utils.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,24 @@ async function addQueriesAndPacksFromWorkflow(
953953
);
954954
injectedMlQueries = injectedMlQueries || didInject;
955955
}
956+
957+
if (packs) {
958+
for (const [language, packsWithVersion] of Object.entries(packs)) {
959+
if (packsWithVersion?.length) {
960+
logger.startGroup(`Downloading custom packs for ${language}`);
961+
const results = await codeQL.packDownload(packsWithVersion);
962+
963+
logger.info(
964+
`Downloaded packs: ${results.packs
965+
.map((r) => `${r.name}@${r.version || "latest"}`)
966+
.join(", ")}`
967+
);
968+
969+
logger.endGroup();
970+
}
971+
}
972+
}
973+
956974
return injectedMlQueries;
957975
}
958976

0 commit comments

Comments
 (0)