Merge main into releases/v4 by github-actions[bot] · Pull Request #4239 · github/codeql-action · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
99fe839
Refactor: Add `determineCheckoutPath` function for `analyze` action
mbg Sep 16, 2026
5dab0cc
Persist repository root from `init` action in CodeQL Action state
mbg Sep 16, 2026
ba615b5
Verify persisted repository root path in `analyze` action
mbg Sep 16, 2026
54a4349
Propagate `checkoutPath` to `getRef`
mbg Sep 16, 2026
f5716fa
Allow `getCheckoutPathInputOrThrow` to get root from config
mbg Sep 22, 2026
6fb4a88
Normalise the results of `getGitRoot`
mbg Sep 22, 2026
a876e23
Add tests for `determineCheckoutPath`
mbg Sep 22, 2026
72509a8
Consistently use resolved path
mbg Sep 22, 2026
5769ffc
Merge remote-tracking branch 'origin/main' into mbg/improve-checkout-…
mbg Sep 28, 2026
c2215db
Update `git-utils` tests
mbg Sep 28, 2026
909fda1
Allow logging functions to accept `string[]` directly
mbg Oct 6, 2026
cb7acf5
Refactor `getCodeQLActionRepository` out of `setup-codeql`
mbg Oct 6, 2026
3f57a00
Use `ActionState` for `getCodeQLActionRepository`
mbg Oct 6, 2026
da07d40
Refactor `getCodeQLBundleDownloadURL` out of `setup-codeql`
mbg Oct 6, 2026
35f12de
Add utility for assertions on sinon stubs with better output by default
mbg Oct 6, 2026
a4f9f6f
Type the `assetKind` parameter
mbg Oct 6, 2026
de99f0e
Add `getDefaultDotComDownloadURL`
mbg Oct 6, 2026
133ffeb
Use `getCodeQLAssetDownloadURL` for `start-proxy`
mbg Oct 6, 2026
f9a9962
Fix `onceWith` not asserting the `once` part
mbg Oct 6, 2026
9a9f454
Hoist core of `changenotes.mts assemble` into own function
mario-campos Oct 6, 2026
fb4048e
Transfer change-notes to CHANGELOG.md via update-release-branch.ts
mario-campos Oct 6, 2026
badda69
Trim whitespace of change-notes before insertion
mario-campos Oct 6, 2026
0f6901c
Commit change-note deletions
mario-campos Oct 6, 2026
aae22cc
Use config vars over hardcoded literals
mario-campos Oct 6, 2026
772ffcd
Bump minimum CodeQL CLI version to 2.20.7
henrymercer Oct 6, 2026
05d28f2
Bump version to 4.39.0
henrymercer Oct 6, 2026
74aeac9
Stop testing CodeQL versions older than 2.20.7 in PR checks
henrymercer Oct 6, 2026
17e7897
Add CodeQL 2.25.6 to the PR check matrix
henrymercer Oct 6, 2026
b97fbb3
Remove `CODEQL_PROXY_*` workaround for CLIs older than 2.20.7
henrymercer Oct 5, 2026
10e415a
Remove Kotlin version limit workaround for CodeQL CLI 2.20.3
henrymercer Oct 5, 2026
3c1b1b6
Remove CodeQL version check from debug artifact upload
henrymercer Oct 5, 2026
a8c7110
Remove unreachable minimum version check for Rust analysis
henrymercer Oct 6, 2026
0b5c1fb
Remove redundant CLI version requirement from `CppDependencyInstallat…
henrymercer Oct 6, 2026
8e7104f
Clarify the oldest-version comment in the Rust PR check
henrymercer Oct 6, 2026
5d90bea
Add PR number to changelog entry and list it first
henrymercer Oct 7, 2026
4f73d1a
Include primary cache keys as restore key
mbg Oct 7, 2026
a36029c
Bump @octokit/plugin-paginate-rest from 15.0.0 to 16.0.0
dependabot[bot] Oct 7, 2026
d5b1e79
Bump eslint-plugin-jsdoc from 64.5.4 to 65.0.1
dependabot[bot] Oct 7, 2026
39f1b3f
Document change-notes process
mario-campos Oct 7, 2026
63c5299
Move `isInTestMode` to `environment.ts`
mbg May 22, 2026
1728f0c
Add wrapper around `core.exportVariable`
mbg May 22, 2026
59ff83e
Add basic eslint enforcement
mbg May 22, 2026
75ea4cb
Add `NODE_ENV` as safe environment variable
mbg May 22, 2026
ebd711f
Deprecate `isInTestMode` in favour of a more clearly named method
mbg Oct 7, 2026
38fee79
Specify allowed characters in change-note filename
mario-campos Oct 7, 2026
ce3f825
Update changelog and version after v4.38.3
github-actions[bot] Oct 8, 2026
ea60dc6
Rebuild
github-actions[bot] Oct 8, 2026
768784f
Merge branch 'main' into henrymercer/require-codeql-2-20-7
henrymercer Oct 8, 2026
5aa5056
Merge pull request #4215 from github/mergeback/v4.38.3-to-main-24c54180
navntoft Oct 8, 2026
2a935ca
Move change-note documentation to `unreleased-change-notes/README.md`
mario-campos Oct 8, 2026
3acc10a
Exclude `README.md` from change-note validation and assembly
mario-campos Oct 8, 2026
d6196d8
Rename `exportVariable` wrapper to `exportEnvVar`
mbg Oct 8, 2026
bd97dda
Add and use `__CODEQL_ACTION_TEST_ENV__` in tests
mbg Oct 8, 2026
40d76bc
Use actual CHANGELOG.md entries for example change-note
mario-campos Oct 8, 2026
cc826bb
Delete unnecessary guidance for change-note body
mario-campos Oct 8, 2026
13b1321
Refine misc. wording of `unreleased-change-notes/README.md`
mario-campos Oct 8, 2026
1ced68e
Do not validate change-note file names or frontmatter
mario-campos Oct 8, 2026
e57c0e6
Fix type inference for `ActionState`
mbg Oct 9, 2026
45cda5b
Delete unused `path` import
mario-campos Oct 9, 2026
68f5b57
Merge pull request #4212 from github/mbg/tests/fix-export-variable-2
mbg Oct 9, 2026
5532d8e
Merge pull request #4218 from github/mario-campos/loosen-changenote-v…
mario-campos Oct 9, 2026
3b399fe
Merge branch 'main' into dependabot/npm_and_yarn/eslint-plugin-jsdoc-…
mbg Oct 9, 2026
71f2680
Merge pull request #4209 from github/dependabot/npm_and_yarn/eslint-p…
mbg Oct 9, 2026
fa56eef
Delete unnecessary filename/frontmatter validation instructions
mario-campos Oct 9, 2026
6e7fe2e
Merge pull request #4220 from github/mbg/fix-action-state-type-inference
mbg Oct 9, 2026
e4e9b26
Merge pull request #4211 from github/mario-campos/document-changenotes
mario-campos Oct 9, 2026
ae96eed
Merge remote-tracking branch 'origin/main' into henrymercer/require-c…
henrymercer Oct 12, 2026
0db2f2b
Merge pull request #4205 from github/henrymercer/require-codeql-2-20-7
henrymercer Oct 12, 2026
cf8f7b9
Add `ActionConfig` type
mbg Oct 12, 2026
309f6af
Change `getGeneratedCodeScanningConfigPath` to not require full `Config`
mbg Oct 12, 2026
317f264
Change `diagnosticsExport` to not require full `Config`
mbg Oct 12, 2026
19445dd
Reduce `Config` requirements for `tryUploadSarifIfRunFailed`
mbg Oct 12, 2026
5136039
Store partial configuration when `init` is aborted
mbg Oct 12, 2026
4fdbb71
Use `runInActions` for `init-post`
mbg Oct 9, 2026
f4a15a1
Try to load failed config if normal config is unavailable
mbg Oct 12, 2026
409be01
Replace deprecated functions in `init-action.post.ts`
mbg Oct 12, 2026
ecfc96e
Add `getDisplayActionName` tests
mbg Oct 12, 2026
ac8654a
Add `printDebugLogs` tests
mbg Oct 12, 2026
0993337
Merge branch 'main' into mbg/set-restore-keys
mbg Oct 12, 2026
265d882
Merge branch 'main' into mbg/start-proxy/deprecate-fallback
mbg Oct 12, 2026
c1b620c
Allow `initializeEnvironment` to accept `Env`
mbg Oct 12, 2026
ad8ebce
Add and use `RepositoryNwoStr` type
mbg Oct 12, 2026
1a92e13
Use `GITHUB_DOTCOM_URL` in `getDefaultDotComDownloadURL`
mbg Oct 12, 2026
e93db40
Use "asset" in comment
mbg Oct 12, 2026
fdc069b
Use `DownloadSource` for `potentialDownloadSources`
mbg Oct 12, 2026
06bd6e2
`DotCom` => `Dotcom`
mbg Oct 12, 2026
3d7016f
Log more in `getProxyBinaryPath`
mbg Oct 12, 2026
dd3898a
Await `toolcache.downloadTool`
mbg Oct 12, 2026
ac44fd0
Remove duplicated assertions
mbg Oct 12, 2026
a1794a0
Fix `mockGetReleaseByTag` usage
mbg Oct 12, 2026
8fed29e
Rename `apiURL` to `instanceURL`
mbg Oct 12, 2026
5aa103d
Add `InstanceURL` and use in `DownloadSource`
mbg Oct 12, 2026
bed4cc0
Add log message for `!config.dbLocation` case
mbg Oct 12, 2026
be78e02
Fix comment
mbg Oct 12, 2026
e3aeabd
Fix example in comment
mbg Oct 12, 2026
26c6f91
Throw if aborted config functions are called incorrectly
mbg Oct 12, 2026
67f44bc
Use `Logger` for `printDebugLogs` and log when returning early
mbg Oct 12, 2026
6a9f7e7
Log if returning early from `recordOverlayStatus` due to no languages
mbg Oct 12, 2026
9645acc
Revert `config === undefined` condition
mbg Oct 12, 2026
eb94de7
Merge pull request #4225 from github/mbg/reduce-config-requirements
mbg Oct 13, 2026
b67b5ab
Use `parseRepositoryNwo` in `getCodeQLAssetDownloadURL`
mbg Oct 13, 2026
aa80ca0
Move `start-proxy` status report handling into its own file
mbg Oct 13, 2026
6308e36
Return release version from `getProxyBinaryPath`
mbg Oct 13, 2026
43db2c0
Include proxy version in telemetry
mbg Oct 13, 2026
a7700b5
Merge branch 'main' into mario-campos/automate-changenotes-assemble
mbg Oct 14, 2026
6aee1f8
Sort `registry_types` in status report
mbg Oct 14, 2026
1580058
Add unit test for `sendSuccessStatusReport`
mbg Oct 14, 2026
a5e9aeb
Merge branch 'main' into dependabot/npm_and_yarn/octokit/plugin-pagin…
mbg Oct 14, 2026
efdb69c
Bump the npm-minor group across 1 directory with 7 updates
dependabot[bot] Oct 14, 2026
25fe42a
Rebuild
github-actions[bot] Oct 14, 2026
4f74769
Merge branch 'main' into mbg/improve-checkout-path
mbg Oct 14, 2026
85944e0
Merge pull request #4234 from github/dependabot/npm_and_yarn/npm-mino…
henrymercer Oct 14, 2026
2b07ff4
Merge pull request #4208 from github/dependabot/npm_and_yarn/octokit/…
henrymercer Oct 14, 2026
9da9625
Merge remote-tracking branch 'origin/main' into mbg/start-proxy/depre…
mbg Oct 14, 2026
71ad3a7
Fix typo in log message
mbg Oct 14, 2026
962aaad
Rename `proxyBin` to `proxyDir`
mbg Oct 14, 2026
28d5dd9
Revert "Allow logging functions to accept `string[]` directly"
mbg Oct 14, 2026
f5b8e09
Merge pull request #4198 from github/mbg/start-proxy/deprecate-fallback
mbg Oct 14, 2026
f460dc7
Merge pull request #4206 from github/mbg/set-restore-keys
mbg Oct 14, 2026
2a3e756
Merge pull request #4148 from github/mbg/improve-checkout-path
mbg Oct 14, 2026
c98271e
Add change note for #4148
mbg Oct 14, 2026
c8bd019
Add change note for #4198
mbg Oct 14, 2026
a897ed5
Add change note for #4206
mbg Oct 14, 2026
ee07b50
Merge pull request #4236 from github/mbg/add-missing-changenotes
mbg Oct 14, 2026
57938b8
Merge pull request #4201 from github/mario-campos/automate-changenote…
mbg Oct 15, 2026
4eabea6
Merge remote-tracking branch 'origin/main' into mbg/start-proxy/repor…
mbg Oct 15, 2026
8dec0b9
Rename `path` to `result` in tests
mbg Oct 15, 2026
d63383a
Merge pull request #4233 from github/mbg/start-proxy/report-version
mbg Oct 15, 2026
4443333
Update changelog for v4.39.0
github-actions[bot] Oct 15, 2026
eb1c428
Trigger workflows
mbg Oct 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
283 changes: 188 additions & 95 deletions lib/entry-points.js

Large diffs are not rendered by default.

205 changes: 95 additions & 110 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
4 changes: 2 additions & 2 deletions pr-checks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"@actions/core": "^2.0.3",
"@actions/github": "^8.0.1",
"@octokit/core": "^7.0.8",
"@octokit/plugin-paginate-rest": ">=15.0.0",
"@octokit/plugin-paginate-rest": ">=16.0.0",
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
"lite-matter": "^0.1.2",
"mdast-util-from-markdown": "^2.0.3",
"mdast-util-from-markdown": "^2.1.0",
"semver": "^7.8.5",
"yaml": "^2.9.1"
},
Expand Down
18 changes: 18 additions & 0 deletions src/action-common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ import { getErrorMessage } from "./util";

setupTests(test);

for (const [key, displayName] of Object.entries(
statusReport.ACTION_DISPLAY_NAMES,
)) {
test(`getDisplayActionName - '${displayName}' instead of '${key}'`, (t) => {
t.is(statusReport.getDisplayActionName(key as ActionName), displayName);
});
}

test("getDisplayActionName - returns action name", (t) => {
for (const actionName of Object.values(ActionName)) {
if (statusReport.ACTION_DISPLAY_NAMES[actionName]) {
continue;
}

t.is(statusReport.getDisplayActionName(actionName), actionName);
}
});

interface RunInActionsTestOpts {
runFn?: () => Promise<any>;
expectedErrorMessage?: string;
Expand Down
20 changes: 18 additions & 2 deletions src/actions-util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import {
isAnalyzingPullRequest,
isDefaultSetup,
isDynamicWorkflow,
printDebugLogs,
} from "./actions-util";
import { computeAutomationID } from "./api-client";
import { EnvVar } from "./environment";
import { getRunnerLogger } from "./logging";
import { setupTests } from "./testing-utils";
import { initializeEnvironment } from "./util";
import { RecordingLogger, setupTests } from "./testing-utils";
import { initializeEnvironment, withTmpDir } from "./util";

setupTests(test);

Expand Down Expand Up @@ -100,6 +101,21 @@ test("computeAutomationID()", async (t) => {
);
});

test("printDebugLogs - doesn't throw when config doesn't have needed properties", async (t) => {
const logger = new RecordingLogger();
await t.notThrowsAsync(printDebugLogs(logger, {}));
await t.notThrowsAsync(printDebugLogs(logger, { languages: [] }));
await t.notThrowsAsync(printDebugLogs(logger, { dbLocation: "nowhere" }));
});

test("printDebugLogs - doesn't throw when language db doesn't exist", async (t) =>
withTmpDir(async (tmpDir) => {
const logger = new RecordingLogger();
await t.notThrowsAsync(
printDebugLogs(logger, { dbLocation: tmpDir, languages: ["javascript"] }),
);
}));

test.serial("getPullRequestBranches() with pull request context", (t) => {
withMockedContext(
{
Expand Down
24 changes: 17 additions & 7 deletions src/actions-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as toolrunner from "@actions/exec/lib/toolrunner";
import * as github from "@actions/github";
import * as io from "@actions/io";

import type { Config } from "./config-utils";
import { hasConfigKey, type Config } from "./config/action-config";
import { Env, EnvVar, ActionsEnvVars, ReadOnlyEnv } from "./environment";
import { Logger } from "./logging";
import {
Expand Down Expand Up @@ -131,28 +131,38 @@ export function getWorkflowEvent(env: Env = getEnv()): any {
}
}

export async function printDebugLogs(config: Config) {
export async function printDebugLogs(logger: Logger, config: Partial<Config>) {
if (
!hasConfigKey(config, "languages") ||
!hasConfigKey(config, "dbLocation")
) {
logger.debug(
`Not printing debug logs, because the configuration does not include the 'languages' or 'dbLocation' fields.`,
);
return;
}

for (const language of config.languages) {
const databaseDirectory = getCodeQLDatabasePath(config, language);
const logsDirectory = path.join(databaseDirectory, "log");
if (!doesDirectoryExist(logsDirectory)) {
core.info(`Directory ${logsDirectory} does not exist.`);
logger.info(`Directory ${logsDirectory} does not exist.`);
continue; // Skip this language database.
}

const walkLogFiles = (dir: string) => {
const entries = fs.readdirSync(dir, { withFileTypes: true });
if (entries.length === 0) {
core.info(`No debug logs found at directory ${logsDirectory}.`);
logger.info(`No debug logs found at directory ${logsDirectory}.`);
}
for (const entry of entries) {
if (entry.isFile()) {
const absolutePath = path.resolve(dir, entry.name);
core.startGroup(
logger.startGroup(
`CodeQL Debug Logs - ${language} - ${entry.name} from file at path ${absolutePath}`,
);
process.stdout.write(fs.readFileSync(absolutePath));
core.endGroup();
logger.info(fs.readFileSync(absolutePath, "utf-8"));
logger.endGroup();
} else if (entry.isDirectory()) {
walkLogFiles(path.resolve(dir, entry.name));
}
Expand Down
3 changes: 2 additions & 1 deletion src/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getTemporaryDirectory } from "./actions-util";
import * as analyses from "./analyses";
import { setupCppAutobuild } from "./autobuild";
import { type CodeQL } from "./codeql";
import type { ActionConfig } from "./config/action-config";
import { defaultSuites } from "./config/db-config";
import * as configUtils from "./config-utils";
import {
Expand Down Expand Up @@ -171,7 +172,7 @@ async function shouldExtractLanguage(
}

export function dbIsFinalized(
config: configUtils.Config,
config: ActionConfig<"dbLocation">,
language: Language,
logger: Logger,
) {
Expand Down
9 changes: 6 additions & 3 deletions src/codeql.ts
Loading