Compare commits

..

7 Commits

Author SHA1 Message Date
Henry Mercer 0630e39f3f Merge pull request #3951 from github/mergeback/v4.36.2-to-main-8aad20d1
Mergeback v4.36.2 refs/heads/releases/v4 into main
2026-06-04 15:07:37 +00:00
Henry Mercer 2b0250fe46 Fix CHANGELOG indentation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-04 15:56:12 +01:00
github-actions[bot] 446948f50b Rebuild 2026-06-04 14:27:34 +00:00
github-actions[bot] d24f3022a8 Update changelog and version after v4.36.2 2026-06-04 14:27:20 +00:00
Henry Mercer 8aad20d150 Merge pull request #3949 from github/update-v4.36.2-dcb947ce1
Merge main into releases/v4
2026-06-04 15:25:45 +01:00
Henry Mercer f521b08cd8 Add additional changelog notes 2026-06-04 15:11:55 +01:00
github-actions[bot] 8aeff0ffb7 Update changelog for v4.36.2 2026-06-04 11:17:27 +00:00
7 changed files with 50 additions and 103 deletions
+6
View File
@@ -4,6 +4,12 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
## [UNRELEASED]
No user facing changes.
## 4.36.2 - 04 Jun 2026
- Cache CodeQL CLI version information across Actions steps. [#3943](https://github.com/github/codeql-action/pull/3943)
- Reduce requests while waiting for analysis processing by using exponential backoff when polling SARIF processing status. [#3937](https://github.com/github/codeql-action/pull/3937)
- Update default CodeQL bundle version to [2.25.6](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.6). [#3948](https://github.com/github/codeql-action/pull/3948)
## 4.36.1 - 02 Jun 2026
+1 -1
View File
@@ -148398,7 +148398,7 @@ function getDiffRangesJsonFilePath() {
return path2.join(getTemporaryDirectory(), PR_DIFF_RANGE_JSON_FILENAME);
}
function getActionVersion() {
return "4.36.2";
return "4.36.3";
}
function getWorkflowEventName() {
return getRequiredEnvParam("GITHUB_EVENT_NAME");
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "codeql",
"version": "4.36.2",
"version": "4.36.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "codeql",
"version": "4.36.2",
"version": "4.36.3",
"license": "MIT",
"workspaces": [
"pr-checks"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "4.36.2",
"version": "4.36.3",
"private": true,
"description": "CodeQL action",
"scripts": {
+39 -23
View File
@@ -736,26 +736,21 @@ async function getCodeQLForCmd(
await runCli(cmd, args);
},
async resolveLanguages() {
let result = util.getCachedCodeQlResolveLanguages(cmd);
if (result === undefined) {
const codeqlArgs = [
"resolve",
"languages",
"--format=json",
...getExtraOptionsFromEnv(["resolve", "languages"]),
];
const output = await runCli(cmd, codeqlArgs);
const codeqlArgs = [
"resolve",
"languages",
"--format=json",
...getExtraOptionsFromEnv(["resolve", "languages"]),
];
const output = await runCli(cmd, codeqlArgs);
try {
result = JSON.parse(output) as ResolveLanguagesOutput;
} catch (e) {
throw new Error(
`Unexpected output from codeql resolve languages: ${e}`,
);
}
util.cacheCodeQlResolveLanguages(cmd, result);
try {
return JSON.parse(output) as ResolveLanguagesOutput;
} catch (e) {
throw new Error(
`Unexpected output from codeql resolve languages: ${e}`,
);
}
return result;
},
async betterResolveLanguages(
{
@@ -974,11 +969,32 @@ async function getCodeQLForCmd(
await new toolrunner.ToolRunner(cmd, args).exec();
},
async resolveExtractor(language: Language): Promise<string> {
// A previous implementation executed `codeql resolve extractor`.
// This can be a bit slow due to the JVM startup cost. Instead, get
// the extractor path from resolveLanguages(), which caches its output.
const extractors = await this.resolveLanguages();
return extractors[language][0];
// Request it using `format=json` so we don't need to strip the trailing new line generated by
// the CLI.
let extractorPath = "";
await new toolrunner.ToolRunner(
cmd,
[
"resolve",
"extractor",
"--format=json",
`--language=${language}`,
"--extractor-include-aliases",
...getExtraOptionsFromEnv(["resolve", "extractor"]),
],
{
silent: true,
listeners: {
stdout: (data) => {
extractorPath += data.toString();
},
stderr: (data) => {
process.stderr.write(data);
},
},
},
).exec();
return JSON.parse(extractorPath) as string;
},
async resolveQueriesStartingPacks(queries: string[]): Promise<string[]> {
const codeqlArgs = [
-6
View File
@@ -23,12 +23,6 @@ export enum EnvVar {
*/
CODEQL_VERSION_INFO = "CODEQL_ACTION_CLI_VERSION_INFO",
/**
* `ResolveLanguagesOutput` for the CodeQL CLI, so later Actions steps can reuse it instead of
* invoking `codeql resolve languages` again.
*/
CODEQL_RESOLVE_LANGUAGES = "CODEQL_ACTION_CLI_RESOLVE_LANGUAGES",
/** Whether the CodeQL Action has invoked the Go autobuilder. */
DID_AUTOBUILD_GOLANG = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG",
+1 -70
View File
@@ -10,7 +10,7 @@ import * as yaml from "js-yaml";
import * as semver from "semver";
import * as apiCompatibility from "./api-compatibility.json";
import type { CodeQL, VersionInfo, ResolveLanguagesOutput } from "./codeql";
import type { CodeQL, VersionInfo } from "./codeql";
import type { Pack } from "./config/db-config";
import type { Config } from "./config-utils";
import { EnvVar } from "./environment";
@@ -701,75 +701,6 @@ export function getCachedCodeQlVersion(cmd?: string): undefined | VersionInfo {
return cachedCodeQlVersion;
}
let cachedCodeQlResolveLanguages: undefined | ResolveLanguagesOutput =
undefined;
interface PersistedResolveLanguagesOutput {
cmd: string;
output: ResolveLanguagesOutput;
}
export function cacheCodeQlResolveLanguages(
cmd: string,
output: ResolveLanguagesOutput,
): void {
if (cachedCodeQlResolveLanguages !== undefined) {
throw new Error("cacheCodeQlResolveLanguages() should be called only once");
}
cachedCodeQlResolveLanguages = output;
// Persist the output so that subsequent Actions steps, which run in separate
// processes, can reuse it rather than invoking `codeql resolve languages` again. We
// record the CLI path so that a different step using a different CodeQL bundle
// doesn't pick up a stale output.
core.exportVariable(
EnvVar.CODEQL_RESOLVE_LANGUAGES,
JSON.stringify({ cmd, output }),
);
}
function isPersistedResolveLanguagesOutput(
value: unknown,
): value is PersistedResolveLanguagesOutput {
return (
typeof value === "object" &&
value !== null &&
typeof (value as Record<string, unknown>).cmd === "string" &&
typeof (value as Record<string, unknown>).output === "object" &&
(value as Record<string, unknown>).output !== null
);
}
export function getCachedCodeQlResolveLanguages(
cmd?: string,
): undefined | ResolveLanguagesOutput {
if (cachedCodeQlResolveLanguages !== undefined) {
return cachedCodeQlResolveLanguages;
}
// Fall back to the value persisted by an earlier Actions step, if any. This is
// best-effort: any malformed or mismatched value is ignored so that the caller
// invokes `codeql resolve languages` instead.
const serialized = process.env[EnvVar.CODEQL_RESOLVE_LANGUAGES];
if (!serialized) {
return undefined;
}
let persisted: unknown;
try {
persisted = JSON.parse(serialized);
} catch {
return undefined;
}
if (
!isPersistedResolveLanguagesOutput(persisted) ||
(cmd !== undefined && persisted.cmd !== cmd)
) {
return undefined;
}
// Memoize the parsed value so that subsequent calls in this process don't
// re-parse the environment variable.
cachedCodeQlResolveLanguages = persisted.output;
return cachedCodeQlResolveLanguages;
}
export async function codeQlVersionAtLeast(
codeql: CodeQL,
requiredVersion: string,