Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
ea6f9c21c0 1.0.3 2021-06-09 20:20:39 +00:00
github-actions[bot]
787712be58 Update changelog and version after v1.0.2 2021-06-09 20:20:37 +00:00
Andrew Eisenberg
a66b44a48a Merge e68056c6d9 into cbdf0df97b 2021-06-09 20:20:07 +00:00
Andrew Eisenberg
e68056c6d9 Add pack download to its own log group
Also, make the baseline count message less awkward sounding.
2021-06-09 13:19:49 -07:00
8 changed files with 18 additions and 10 deletions

View File

@@ -2,6 +2,8 @@
## [UNRELEASED]
## [UNRELEASED]
## 1.0.1 - 07 Jun 2021
- Pass the `--sarif-group-rules-by-pack` argument to CodeQL CLI invocations that generate SARIF. This means the SARIF rule object for each query will now be found underneath its corresponding query pack in `runs[].tool.extensions`. [#546](https://github.com/github/codeql-action/pull/546)

6
lib/analyze.js generated
View File

@@ -85,7 +85,6 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
// that here.
config.paths, config.pathsIgnore, config.languages, logger);
for (const language of config.languages) {
logger.startGroup(`Running queries for ${language}`);
const queries = config.queries[language];
const packsWithVersion = config.packs[language] || [];
const hasBuiltinQueries = ((_a = queries) === null || _a === void 0 ? void 0 : _a.builtin.length) > 0;
@@ -96,12 +95,15 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
}
try {
if (hasPackWithCustomQueries) {
logger.startGroup(`Downloading custom packs for ${language}`);
const codeql = codeql_1.getCodeQL(config.codeQLCmd);
const results = await codeql.packDownload(packsWithVersion);
logger.info(`Downloaded packs: ${results.packs
.map((r) => `${r.name}@${r.version || "latest"}`)
.join(", ")}`);
logger.endGroup();
}
logger.startGroup(`Running queries for ${language}`);
const querySuitePaths = [];
if (queries["builtin"].length > 0) {
const startTimeBuiltIn = new Date().getTime();
@@ -222,7 +224,7 @@ async function injectLinesOfCode(sarifFile, language, locPromise) {
}
function printLinesOfCodeSummary(logger, language, lineCounts) {
if (language in lineCounts) {
logger.info(`Counted ${lineCounts[language]} lines of code for ${language} as a baseline.`);
logger.info(`Counted a baseline of ${lineCounts[language]} lines of code for ${language}.`);
}
}
//# sourceMappingURL=analyze.js.map

File diff suppressed because one or more lines are too long

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "1.0.2",
"version": "1.0.3",
"private": true,
"description": "CodeQL action",
"scripts": {

View File

@@ -1,6 +1,6 @@
{
"name": "codeql-runner",
"version": "1.0.2",
"version": "1.0.3",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "codeql-runner",
"version": "1.0.2",
"version": "1.0.3",
"private": true,
"description": "CodeQL runner",
"scripts": {

View File

@@ -176,14 +176,13 @@ export async function runQueries(
);
for (const language of config.languages) {
logger.startGroup(`Running queries for ${language}`);
const queries = config.queries[language];
const packsWithVersion = config.packs[language] || [];
const hasBuiltinQueries = queries?.builtin.length > 0;
const hasCustomQueries = queries?.custom.length > 0;
const hasPackWithCustomQueries = packsWithVersion.length > 0;
if (!hasBuiltinQueries && !hasCustomQueries && !hasPackWithCustomQueries) {
throw new Error(
`Unable to analyse ${language} as no queries were selected for this language`
@@ -192,6 +191,8 @@ export async function runQueries(
try {
if (hasPackWithCustomQueries) {
logger.startGroup(`Downloading custom packs for ${language}`);
const codeql = getCodeQL(config.codeQLCmd);
const results = await codeql.packDownload(packsWithVersion);
logger.info(
@@ -199,8 +200,11 @@ export async function runQueries(
.map((r) => `${r.name}@${r.version || "latest"}`)
.join(", ")}`
);
logger.endGroup();
}
logger.startGroup(`Running queries for ${language}`);
const querySuitePaths: string[] = [];
if (queries["builtin"].length > 0) {
const startTimeBuiltIn = new Date().getTime();
@@ -419,7 +423,7 @@ function printLinesOfCodeSummary(
) {
if (language in lineCounts) {
logger.info(
`Counted ${lineCounts[language]} lines of code for ${language} as a baseline.`
`Counted a baseline of ${lineCounts[language]} lines of code for ${language}.`
);
}
}