Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: github/codeql-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.29
Choose a base ref
...
head repository: github/codeql-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.0.30
Choose a head ref
  • 14 commits
  • 14 files changed
  • 4 contributors

Commits on Jan 20, 2022

  1. Include better error message

    When users call init multiple times.
    aeisenberg committed Jan 20, 2022
    Copy the full SHA
    51126e5 View commit details
  2. Update changelog

    Add a line item for using a better error message.
    
    Also, add a link for an entry that didn't have one before.
    aeisenberg committed Jan 20, 2022
    Copy the full SHA
    c8290d0 View commit details

Commits on Jan 21, 2022

  1. Update changelog and version after v1.0.29

    github-actions[bot] committed Jan 21, 2022
    Copy the full SHA
    ac9d34f View commit details
  2. 1.0.30

    github-actions[bot] committed Jan 21, 2022
    Copy the full SHA
    c2fb041 View commit details
  3. Update checked-in dependencies

    github-actions[bot] committed Jan 21, 2022
    Copy the full SHA
    57c4e97 View commit details
  4. Merge pull request #880 from github/mergeback/v1.0.29-to-main-384cfc42

    Mergeback v1.0.29 refs/heads/v1 into main
    edoardopirovano authored Jan 21, 2022
    Copy the full SHA
    d76304c View commit details
  5. Copy the full SHA
    14b4839 View commit details
  6. Merge pull request #881 from github/edoardo/respect-env

    Respect extra options in a few `codeql` calls
    edoardopirovano authored Jan 21, 2022
    Copy the full SHA
    fdb92bb View commit details
  7. Copy the full SHA
    5e69ce8 View commit details
  8. Merge pull request #876 from github/aeisenberg/multi-init

    Include better error message
    aeisenberg authored Jan 21, 2022
    Copy the full SHA
    0dabead View commit details

Commits on Jan 24, 2022

  1. Copy the full SHA
    3b4e4d4 View commit details
  2. Merge pull request #877 from github/codeql-cli-2.7.6

    Update default CodeQL version to 2.7.6
    edoardopirovano authored Jan 24, 2022
    Copy the full SHA
    a7adbce View commit details
  3. 1.0.30

    github-actions[bot] committed Jan 24, 2022
    Copy the full SHA
    c180f23 View commit details
  4. Merge pull request #883 from github/update-v1.0.30-a7adbce2

    Merge main into v1
    edoardopirovano authored Jan 24, 2022
    Copy the full SHA
    8b37404 View commit details
Showing with 86 additions and 37 deletions.
  1. +6 −1 CHANGELOG.md
  2. +8 −1 lib/codeql.js
  3. +1 −1 lib/codeql.js.map
  4. +1 −1 lib/defaults.json
  5. +22 −7 lib/init.js
  6. +1 −1 lib/init.js.map
  7. +1 −1 node_modules/.package-lock.json
  8. +2 −2 package-lock.json
  9. +1 −1 package.json
  10. +1 −1 runner/package-lock.json
  11. +1 −1 runner/package.json
  12. +8 −1 src/codeql.ts
  13. +1 −1 src/defaults.json
  14. +32 −17 src/init.ts
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CodeQL Action and CodeQL Runner Changelog

## 1.0.30 - 24 Jan 2022

- Display a better error message when encountering a workflow that runs the `codeql-action/init` action multiple times. [#876](https://github.com/github/codeql-action/pull/876)
- Update default CodeQL bundle version to 2.7.6. [#877](https://github.com/github/codeql-action/pull/877)

## 1.0.29 - 21 Jan 2022

- The feature to wait for SARIF processing to complete after upload has been disabled by default due to a bug in its interaction with pull requests from forks.
@@ -11,7 +16,7 @@

## 1.0.27 - 11 Jan 2022

- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`.
- The `analyze` and `upload-sarif` actions will now wait up to 2 minutes for processing to complete after they have uploaded the results so they can report any processing errors that occurred. This behavior can be disabled by setting the `wait-for-processing` action input to `"false"`. [#855](https://github.com/github/codeql-action/pull/855)

## 1.0.26 - 10 Dec 2021

9 changes: 8 additions & 1 deletion lib/codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/defaults.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20220112"
"bundleVersion": "codeql-bundle-20220120"
}
29 changes: 22 additions & 7 deletions lib/init.js
2 changes: 1 addition & 1 deletion lib/init.js.map
2 changes: 1 addition & 1 deletion node_modules/.package-lock.json
4 changes: 2 additions & 2 deletions package-lock.json
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "1.0.29",
"version": "1.0.30",
"private": true,
"description": "CodeQL action",
"scripts": {
2 changes: 1 addition & 1 deletion runner/package-lock.json
2 changes: 1 addition & 1 deletion runner/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeql-runner",
"version": "1.0.29",
"version": "1.0.30",
"private": true,
"description": "CodeQL runner",
"scripts": {
9 changes: 8 additions & 1 deletion src/codeql.ts
Original file line number Diff line number Diff line change
@@ -805,7 +805,12 @@ async function getCodeQLForCmd(
await toolrunnerErrorCatcher(cmd, args, errorMatchers);
},
async resolveLanguages() {
const codeqlArgs = ["resolve", "languages", "--format=json"];
const codeqlArgs = [
"resolve",
"languages",
"--format=json",
...getExtraOptionsFromEnv(["resolve", "languages"]),
];
const output = await runTool(cmd, codeqlArgs);

try {
@@ -956,6 +961,7 @@ async function getCodeQLForCmd(
"cleanup",
databasePath,
`--mode=${cleanupLevel}`,
...getExtraOptionsFromEnv(["database", "cleanup"]),
];
await runTool(cmd, codeqlArgs);
},
@@ -970,6 +976,7 @@ async function getCodeQLForCmd(
databasePath,
`--output=${outputFilePath}`,
`--name=${databaseName}`,
...getExtraOptionsFromEnv(["database", "bundle"]),
];
await new toolrunner.ToolRunner(cmd, args).exec();
},
2 changes: 1 addition & 1 deletion src/defaults.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"bundleVersion": "codeql-bundle-20220112"
"bundleVersion": "codeql-bundle-20220120"
}
49 changes: 32 additions & 17 deletions src/init.ts
Original file line number Diff line number Diff line change
@@ -91,26 +91,41 @@ export async function runInit(
): Promise<TracerConfig | undefined> {
fs.mkdirSync(config.dbLocation, { recursive: true });

if (await codeQlVersionAbove(codeql, CODEQL_VERSION_NEW_TRACING)) {
// Init a database cluster
await codeql.databaseInitCluster(
config.dbLocation,
config.languages,
sourceRoot,
processName,
processLevel
);
} else {
for (const language of config.languages) {
// Init language database
await codeql.databaseInit(
util.getCodeQLDatabasePath(config, language),
language,
sourceRoot
try {
if (await codeQlVersionAbove(codeql, CODEQL_VERSION_NEW_TRACING)) {
// Init a database cluster
await codeql.databaseInitCluster(
config.dbLocation,
config.languages,
sourceRoot,
processName,
processLevel
);
} else {
for (const language of config.languages) {
// Init language database
await codeql.databaseInit(
util.getCodeQLDatabasePath(config, language),
language,
sourceRoot
);
}
}
} catch (e) {
// Handle the situation where init is called twice
// for the same database in the same job.
if (
e instanceof Error &&
e.message?.includes("Refusing to create databases") &&
e.message.includes("exists and is not an empty directory.")
) {
throw new Error(
`Is the "init" action called twice in the same job? ${e.message}`
);
} else {
throw e;
}
}

return await getCombinedTracerConfig(config, codeql);
}