mirror of
https://github.com/github/codeql-action.git
synced 2025-12-06 15:58:06 +08:00
Compare commits
4 Commits
codeql-bun
...
mergeback/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea6f9c21c0 | ||
|
|
787712be58 | ||
|
|
a66b44a48a | ||
|
|
e68056c6d9 |
@@ -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
6
lib/analyze.js
generated
@@ -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
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"private": true,
|
||||
"description": "CodeQL action",
|
||||
"scripts": {
|
||||
|
||||
2
runner/package-lock.json
generated
2
runner/package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql-runner",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql-runner",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"private": true,
|
||||
"description": "CodeQL runner",
|
||||
"scripts": {
|
||||
|
||||
@@ -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}.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user