Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
7dcea06
Remove unused `@schemastore/package` dependency
henrymercer Mar 27, 2026
f13c600
Bump brace-expansion from 1.1.12 to 1.1.13
dependabot[bot] Mar 27, 2026
999119b
Rebuild
github-actions[bot] Mar 27, 2026
6010f9d
Update changelog and version after v4.35.1
github-actions[bot] Mar 27, 2026
cc7db4a
Rebuild
github-actions[bot] Mar 27, 2026
353802f
Move time-sensitive Actions workflows to `ubuntu-latest`
henrymercer Mar 27, 2026
fe775da
Merge pull request #3780 from github/dependabot/npm_and_yarn/brace-ex…
henrymercer Mar 27, 2026
aa69c48
Merge pull request #3779 from github/henrymercer/remove-unused-depend…
henrymercer Mar 27, 2026
191d7c6
Merge pull request #3783 from github/mergeback/v4.35.1-to-main-c10b8064
henrymercer Mar 27, 2026
4ed3c0e
Generate esbuild metadata file
mbg Mar 27, 2026
a899987
Merge pull request #3786 from github/henrymercer/faster-interactive-jobs
henrymercer Mar 27, 2026
b1981a5
Move `getApiClient` out of `sync-checks.ts`
mbg Mar 27, 2026
47f1709
Add basic metadata analysis script
mbg Mar 27, 2026
6643a7d
Only require Git 2.36.0 when repo contains submodules
henrymercer Mar 27, 2026
88a7e51
Don't disable if we don't need the git version
henrymercer Mar 27, 2026
0592832
Add changelog note
henrymercer Mar 27, 2026
4e0952a
Output largest inputs
mbg Mar 27, 2026
3db32b5
Fix `outputs` type
mbg Mar 27, 2026
f98bf5e
Output relative to `__dirname`
mbg Mar 27, 2026
be0a156
Save a computation of the git root
henrymercer Mar 30, 2026
a507a54
Test fallback when repo has no submodules
henrymercer Mar 30, 2026
0c7c298
Extend start-proxy.yml to test multiple registry support
mario-campos Mar 30, 2026
9fd9b64
Replace `jq` with Actions expression for proxy_urls validation
mario-campos Mar 31, 2026
c618c9b
Merge pull request #3789 from github/henrymercer/lower-minimum-git-if…
henrymercer Mar 31, 2026
99b8dd4
Run `pr-checks/sync.sh` to generate __start-proxy.yml.
mario-campos Mar 31, 2026
8b5e604
Use `maven_repository`, not `maven-repository`
mario-campos Mar 31, 2026
faf45e0
Use different maven URL for start-proxy.yml test
mario-campos Mar 31, 2026
7b0c5b1
Keep validation steps named consistently
mario-campos Mar 31, 2026
e2203c6
Delete `fromJSON()` calls in test validation step
mario-campos Mar 31, 2026
2e3aaae
Merge pull request #3787 from github/mbg/bundle/metadata
mbg Apr 1, 2026
1f4c852
Clean up Python extract stdlib feature flag
henrymercer Apr 1, 2026
311573e
Add changelog note
henrymercer Apr 1, 2026
57ec7e1
Merge pull request #3794 from github/henrymercer/cleanup
henrymercer Apr 1, 2026
34950e1
Merge pull request #3792 from github/mario-campos/issue-1664
mbg Apr 1, 2026
36075a4
Deprecate TRAP cache cleanup
henrymercer Apr 1, 2026
212e283
Upgrade to TypeScript 6
henrymercer Apr 2, 2026
5f323ca
Mark Swift incompatible OS as configuration error
henrymercer Apr 2, 2026
e25c0a5
Merge pull request #3795 from github/henrymercer/deprecate-trap-cachi…
henrymercer Apr 7, 2026
1065967
Merge pull request #3800 from github/henrymercer/typescript-6
henrymercer Apr 7, 2026
de1752b
Bump lodash from 4.17.23 to 4.18.1
dependabot[bot] Apr 7, 2026
6eed62b
Bump eslint-plugin-jsdoc in the npm-minor group across 1 directory
dependabot[bot] Apr 7, 2026
347f0c6
Merge pull request #3803 from github/dependabot/npm_and_yarn/npm-mino…
henrymercer Apr 7, 2026
e6c8394
Merge pull request #3802 from github/dependabot/npm_and_yarn/lodash-4…
henrymercer Apr 7, 2026
f8aff3a
Add tests for getCredentials with multiple goproxy_servers and maven_…
mario-campos Apr 2, 2026
43d8864
Run `npm run lint-fix` to format the code
mario-campos Apr 2, 2026
14ed573
Specify "Go" for a test case
mario-campos Apr 7, 2026
35a3898
Specify "Java" for a test case
mario-campos Apr 7, 2026
b623f5f
Merge pull request #3799 from github/mario-campos/test-multiple-regis…
mario-campos Apr 7, 2026
e452857
Throw error early rather than warning
henrymercer Apr 8, 2026
808513f
Update language aliases test
henrymercer Apr 8, 2026
751f3e2
Bump eslint-plugin-jsdoc from 62.8.1 to 62.9.0 in the npm-minor group
dependabot[bot] Apr 8, 2026
76a687e
Merge pull request #3804 from github/dependabot/npm_and_yarn/npm-mino…
henrymercer Apr 9, 2026
43d8420
Do not run Swift in debug artifacts after failure check
henrymercer Apr 9, 2026
5a17511
Throw error on Windows too
henrymercer Apr 9, 2026
51d8332
Store language aliases from linked CLI
henrymercer Apr 9, 2026
111a537
Update `start-proxy` Action to use known language aliases
henrymercer Apr 9, 2026
d277a56
Fix OIDC credential property names
mbg Apr 9, 2026
597e12a
Merge pull request #3801 from github/henrymercer/swift-incompatible-os
henrymercer Apr 9, 2026
7197c2b
Add changelog entry
mbg Apr 9, 2026
60991e6
Merge pull request #3806 from github/henrymercer/store-language-aliases
henrymercer Apr 10, 2026
a26cb68
Merge pull request #3807 from github/mbg/start-proxy/fix-field-names
mbg Apr 10, 2026
1cf0431
Set `module` option for `pr-checks/tsconfig.json`
mbg Apr 10, 2026
4e8c9ce
Refactoring: Introduce `overlay/caching.ts`
henrymercer Apr 10, 2026
b669eab
Explicitly add `pr-checks` to Dependabot config
mbg Apr 10, 2026
ee09113
Merge pull request #3810 from github/mbg/ts6/fix-pr-checks
mbg Apr 10, 2026
8339b92
Merge pull request #3819 from github/henrymercer/refactor-overlay-cac…
henrymercer Apr 13, 2026
c1403f0
Bump the actions-minor group across 1 directory with 2 updates
dependabot[bot] Apr 13, 2026
9dd4cfe
Bump the npm-minor group across 1 directory with 6 updates
dependabot[bot] Apr 13, 2026
1024fc4
Rebuild
github-actions[bot] Apr 13, 2026
f1c3393
Rebuild
github-actions[bot] Apr 13, 2026
3c45af2
Merge pull request #3821 from github/dependabot/npm_and_yarn/npm-mino…
henrymercer Apr 13, 2026
6521697
Merge pull request #3820 from github/dependabot/github_actions/dot-gi…
henrymercer Apr 13, 2026
5a0a562
Update default bundle to codeql-bundle-v2.25.2
github-actions[bot] Apr 15, 2026
60abb65
Add changelog note
github-actions[bot] Apr 15, 2026
d2e135a
Merge pull request #3823 from github/update-bundle/codeql-bundle-v2.25.2
henrymercer Apr 15, 2026
6f31bfe
Update changelog for v4.35.2
github-actions[bot] Apr 15, 2026
95e58e9
Merge pull request #3824 from github/update-v4.35.2-d2e135a73
henrymercer Apr 15, 2026
7ca2158
Revert "Update version and changelog for v3.35.1"
github-actions[bot] Apr 15, 2026
047c547
Revert "Rebuild"
github-actions[bot] Apr 15, 2026
834786a
Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35…
github-actions[bot] Apr 15, 2026
8bcc8f2
Update version and changelog for v3.35.2
github-actions[bot] Apr 15, 2026
c186c7b
Rebuild
github-actions[bot] Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

## [UNRELEASED]

No user facing changes.
- The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. [#3789](https://github.com/github/codeql-action/pull/3789)

## 4.35.1 - 27 Mar 2026

Expand Down
1,540 changes: 774 additions & 766 deletions lib/analyze-action-post.js

Large diffs are not rendered by default.

744 changes: 376 additions & 368 deletions lib/analyze-action.js

Large diffs are not rendered by default.

624 changes: 316 additions & 308 deletions lib/autobuild-action.js

Large diffs are not rendered by default.

1,658 changes: 833 additions & 825 deletions lib/init-action-post.js

Large diffs are not rendered by default.

781 changes: 396 additions & 385 deletions lib/init-action.js

Large diffs are not rendered by default.

602 changes: 305 additions & 297 deletions lib/resolve-environment-action.js

Large diffs are not rendered by default.

628 changes: 318 additions & 310 deletions lib/setup-codeql-action.js

Large diffs are not rendered by default.

686 changes: 347 additions & 339 deletions lib/upload-lib.js

Large diffs are not rendered by default.

694 changes: 351 additions & 343 deletions lib/upload-sarif-action.js

Large diffs are not rendered by default.

32 changes: 25 additions & 7 deletions src/config-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,7 @@ interface OverlayDatabaseModeTestSetup {
codeqlVersion: string;
gitRoot: string | undefined;
gitVersion: GitVersionInfo | undefined;
hasSubmodules: boolean;
codeScanningConfig: UserConfig;
diskUsage: DiskUsage | undefined;
memoryFlagValue: number;
Expand All @@ -1020,10 +1021,8 @@ const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = {
languages: [KnownLanguage.javascript],
codeqlVersion: CODEQL_OVERLAY_MINIMUM_VERSION,
gitRoot: "/some/git/root",
gitVersion: new GitVersionInfo(
gitUtils.GIT_MINIMUM_VERSION_FOR_OVERLAY,
gitUtils.GIT_MINIMUM_VERSION_FOR_OVERLAY,
),
gitVersion: new GitVersionInfo("2.39.0", "2.39.0"),
hasSubmodules: false,
codeScanningConfig: {},
diskUsage: {
numAvailableBytes: 50_000_000_000,
Expand Down Expand Up @@ -1099,6 +1098,9 @@ const checkOverlayEnablementMacro = test.macro({
sinon.stub(gitUtils, "getGitRoot").resolves(setup.gitRoot);
}

// Mock submodule detection
sinon.stub(gitUtils, "hasSubmodules").returns(setup.hasSubmodules);

// Mock default branch detection
sinon
.stub(gitUtils, "isAnalyzingDefaultBranch")
Expand Down Expand Up @@ -1933,10 +1935,11 @@ test.serial(

test.serial(
checkOverlayEnablementMacro,
"Fallback due to old git version",
"Fallback due to old git version with submodules",
{
overlayDatabaseEnvVar: "overlay",
gitVersion: new GitVersionInfo("2.10.0", "2.10.0"), // Version below required 2.11.0
gitVersion: new GitVersionInfo("2.34.1", "2.34.1"), // Above 2.11.0 but below 2.36.0
hasSubmodules: true,
},
{
disabledReason: OverlayDisabledReason.IncompatibleGit,
Expand All @@ -1945,16 +1948,31 @@ test.serial(

test.serial(
checkOverlayEnablementMacro,
"Fallback when git version cannot be determined",
"Fallback when git version cannot be determined and repo has submodules",
{
overlayDatabaseEnvVar: "overlay",
gitVersion: undefined,
hasSubmodules: true,
},
{
disabledReason: OverlayDisabledReason.IncompatibleGit,
},
);

test.serial(
checkOverlayEnablementMacro,
"Overlay enabled when git version cannot be determined and repo has no submodules",
{
overlayDatabaseEnvVar: "overlay",
gitVersion: undefined,
hasSubmodules: false,
},
{
overlayDatabaseMode: OverlayDatabaseMode.Overlay,
useOverlayDatabaseCaching: false,
},
);

test.serial(
checkOverlayEnablementMacro,
"No overlay when disabled via repository property",
Expand Down
41 changes: 24 additions & 17 deletions src/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ import {
getGeneratedFiles,
getGitRoot,
getGitVersionOrThrow,
GIT_MINIMUM_VERSION_FOR_OVERLAY,
GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES,
GitVersionInfo,
hasSubmodules,
isAnalyzingDefaultBranch,
} from "./git-utils";
import { KnownLanguage, Language } from "./languages";
Expand Down Expand Up @@ -969,29 +970,35 @@ async function validateOverlayDatabaseMode(
);
return new Failure(OverlayDisabledReason.IncompatibleCodeQl);
}
if ((await getGitRoot(sourceRoot)) === undefined) {
const gitRoot = await getGitRoot(sourceRoot);
if (gitRoot === undefined) {
logger.warning(
`Cannot build an ${overlayDatabaseMode} database because ` +
`the source root "${sourceRoot}" is not inside a git repository. ` +
"Falling back to creating a normal full database instead.",
);
return new Failure(OverlayDisabledReason.NoGitRoot);
}
if (gitVersion === undefined) {
logger.warning(
`Cannot build an ${overlayDatabaseMode} database because ` +
"the Git version could not be determined. " +
"Falling back to creating a normal full database instead.",
);
return new Failure(OverlayDisabledReason.IncompatibleGit);
}
if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY)) {
logger.warning(
`Cannot build an ${overlayDatabaseMode} database because ` +
`the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY}. ` +
"Falling back to creating a normal full database instead.",
);
return new Failure(OverlayDisabledReason.IncompatibleGit);
if (hasSubmodules(gitRoot)) {
if (gitVersion === undefined) {
logger.warning(
`Cannot build an ${overlayDatabaseMode} database because ` +
"the repository has submodules and the Git version could not be determined. " +
"Falling back to creating a normal full database instead.",
);
return new Failure(OverlayDisabledReason.IncompatibleGit);
}
if (
!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES)
) {
logger.warning(
`Cannot build an ${overlayDatabaseMode} database because ` +
"the repository has submodules and the installed Git version is older " +
`than ${GIT_MINIMUM_VERSION_FOR_OVERLAY_WITH_SUBMODULES}. ` +
"Falling back to creating a normal full database instead.",
);
return new Failure(OverlayDisabledReason.IncompatibleGit);
}
}

return new Success({
Expand Down
179 changes: 123 additions & 56 deletions src/git-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,75 +343,142 @@ test.serial("decodeGitFilePath quoted strings", async (t) => {
);
});

test.serial("getFileOidsUnderPath returns correct file mapping", async (t) => {
const runGitCommandStub = sinon
.stub(gitUtils as any, "runGitCommand")
.resolves(
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
"100644 d89514599a9a99f22b4085766d40af7b99974827 0\tlib/git-utils.js.map\n" +
"100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts",
);

const result = await gitUtils.getFileOidsUnderPath("/fake/path");

t.deepEqual(result, {
"lib/git-utils.js": "30d998ded095371488be3a729eb61d86ed721a18",
"lib/git-utils.js.map": "d89514599a9a99f22b4085766d40af7b99974827",
"src/git-utils.ts": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
});
test.serial(
"getFileOidsUnderPath uses --recurse-submodules when submodules exist",
async (t) => {
await withTmpDir(async (tmpDir) => {
fs.writeFileSync(path.join(tmpDir, ".gitmodules"), "");
const runGitCommandStub = sinon
.stub(gitUtils as any, "runGitCommand")
.callsFake(async (_cwd: any, args: any) => {
if (args[0] === "rev-parse") {
return `${tmpDir}\n`;
}
return (
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
"100644 d89514599a9a99f22b4085766d40af7b99974827 0\tlib/git-utils.js.map\n" +
"100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts"
);
});

const result = await gitUtils.getFileOidsUnderPath("/fake/path");

t.deepEqual(result, {
"lib/git-utils.js": "30d998ded095371488be3a729eb61d86ed721a18",
"lib/git-utils.js.map": "d89514599a9a99f22b4085766d40af7b99974827",
"src/git-utils.ts": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
});

// Second call (after getGitRoot) should include --recurse-submodules
t.deepEqual(runGitCommandStub.secondCall.args[1], [
"ls-files",
"--recurse-submodules",
"--stage",
]);
});
},
);

t.deepEqual(runGitCommandStub.firstCall.args, [
"/fake/path",
["ls-files", "--recurse-submodules", "--stage"],
"Cannot list Git OIDs of tracked files.",
]);
});
test.serial(
"getFileOidsUnderPath omits --recurse-submodules when no submodules exist",
async (t) => {
await withTmpDir(async (tmpDir) => {
const runGitCommandStub = sinon
.stub(gitUtils as any, "runGitCommand")
.callsFake(async (_cwd: any, args: any) => {
if (args[0] === "rev-parse") {
return `${tmpDir}\n`;
}
return (
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
"100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts"
);
});

const result = await gitUtils.getFileOidsUnderPath("/fake/path");

t.deepEqual(result, {
"lib/git-utils.js": "30d998ded095371488be3a729eb61d86ed721a18",
"src/git-utils.ts": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
});

// Second call (after getGitRoot) should NOT include --recurse-submodules
t.deepEqual(runGitCommandStub.secondCall.args[1], [
"ls-files",
"--stage",
]);
});
},
);

test.serial("getFileOidsUnderPath handles quoted paths", async (t) => {
sinon
.stub(gitUtils as any, "runGitCommand")
.resolves(
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/normal-file.js\n" +
'100644 d89514599a9a99f22b4085766d40af7b99974827 0\t"lib/file with spaces.js"\n' +
'100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\t"lib/file\\twith\\ttabs.js"',
);

const result = await gitUtils.getFileOidsUnderPath("/fake/path");

t.deepEqual(result, {
"lib/normal-file.js": "30d998ded095371488be3a729eb61d86ed721a18",
"lib/file with spaces.js": "d89514599a9a99f22b4085766d40af7b99974827",
"lib/file\twith\ttabs.js": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
await withTmpDir(async (tmpDir) => {
sinon
.stub(gitUtils as any, "runGitCommand")
.callsFake(async (_cwd: any, args: any) => {
if (args[0] === "rev-parse") {
return `${tmpDir}\n`;
}
return (
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/normal-file.js\n" +
'100644 d89514599a9a99f22b4085766d40af7b99974827 0\t"lib/file with spaces.js"\n' +
'100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\t"lib/file\\twith\\ttabs.js"'
);
});

const result = await gitUtils.getFileOidsUnderPath("/fake/path");

t.deepEqual(result, {
"lib/normal-file.js": "30d998ded095371488be3a729eb61d86ed721a18",
"lib/file with spaces.js": "d89514599a9a99f22b4085766d40af7b99974827",
"lib/file\twith\ttabs.js": "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96",
});
});
});

test.serial("getFileOidsUnderPath handles empty output", async (t) => {
sinon.stub(gitUtils as any, "runGitCommand").resolves("");

const result = await gitUtils.getFileOidsUnderPath("/fake/path");
t.deepEqual(result, {});
await withTmpDir(async (tmpDir) => {
sinon
.stub(gitUtils as any, "runGitCommand")
.callsFake(async (_cwd: any, args: any) => {
if (args[0] === "rev-parse") {
return `${tmpDir}\n`;
}
return "";
});

const result = await gitUtils.getFileOidsUnderPath("/fake/path");
t.deepEqual(result, {});
});
});

test.serial(
"getFileOidsUnderPath throws on unexpected output format",
async (t) => {
sinon
.stub(gitUtils as any, "runGitCommand")
.resolves(
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
"invalid-line-format\n" +
"100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts",
);
await withTmpDir(async (tmpDir) => {
sinon
.stub(gitUtils as any, "runGitCommand")
.callsFake(async (_cwd: any, args: any) => {
if (args[0] === "rev-parse") {
return `${tmpDir}\n`;
}
return (
"100644 30d998ded095371488be3a729eb61d86ed721a18 0\tlib/git-utils.js\n" +
"invalid-line-format\n" +
"100644 a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96 0\tsrc/git-utils.ts"
);
});

await t.throwsAsync(
async () => {
await gitUtils.getFileOidsUnderPath("/fake/path");
},
{
instanceOf: Error,
message: 'Unexpected "git ls-files" output: invalid-line-format',
},
);
await t.throwsAsync(
async () => {
await gitUtils.getFileOidsUnderPath("/fake/path");
},
{
instanceOf: Error,
message: 'Unexpected "git ls-files" output: invalid-line-format',
},
);
});
},
);

Expand Down
Loading
Loading