Skip to content

Commit de3ece6

Browse files
authored
Merge branch 'main' into mbg/ci/fix-sync-back
2 parents cc88e02 + 093c0af commit de3ece6

10 files changed

Lines changed: 47 additions & 119 deletions

File tree

‎.github/workflows/update-bundle.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ jobs:
113113
echo "CLI_VERSION=$cli_version" | tee -a "$GITHUB_ENV"
114114
echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV"
115115
116-
- name: Create changelog note
116+
- name: Create changenote
117117
run: |
118118
npx tsx pr-checks/bundle-changelog.ts
119119
120-
- name: Push changelog note
120+
- name: Push changenote
121121
run: |
122-
git commit -am "Add changelog note"
122+
git add unreleased-change-notes
123+
git commit -m "Add changenote"
123124
git push

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
44

55
## [UNRELEASED]
66

7+
No user facing changes.
8+
9+
## 4.39.2 - 03 Nov 2026
10+
711
- Update default CodeQL bundle version to [2.27.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.4). [#4284](https://github.com/github/codeql-action/pull/4284)
12+
- _Upcoming breaking change_: CodeQL version 2.22.3 and earlier were discontinued on 16 October 2026 alongside GitHub Enterprise Server 3.18, and will be unsupported by the next minor release of the CodeQL Action. Added a deprecation warning for customers using these versions of CodeQL. [#4266](https://github.com/github/codeql-action/pull/4266)
13+
- Starting with macOS 27 and Xcode 27, traced analyses are unsupported. See [this blog post for more information](https://github.blog/changelog/2026-10-19-codeql-changes-for-macos-27-xcode-27-and-swift-6-4/). The CodeQL Action will now try to identify if a workflow is about to perform a traced analysis on version 27 or above of macOS or Xcode. If so, the CodeQL Action will emit a corresponding warning that will also be visible on the [Tool Status Page](https://docs.github.com/en/code-security/how-tos/find-and-fix-code-vulnerabilities/manage-your-configuration/use-the-tools-status-page-for-code-scanning). This check will be rolled out following this release of the CodeQL Action. [#4221](https://github.com/github/codeql-action/pull/4221)
14+
- The undocumented TRAP cache cleanup feature that could be enabled using the `CODEQL_ACTION_CLEANUP_TRAP_CACHES` environment variable has been removed, as announced in the release notes for CodeQL Action 4.35.2. The `analyze` Action now warns if this environment variable is set. If you used TRAP cache cleanup to limit Actions cache usage, we recommend disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action. [#4243](https://github.com/github/codeql-action/pull/4243)
815

916
## 4.39.1 - 21 Oct 2026
1017

‎lib/entry-points.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeql",
3-
"version": "4.39.2",
3+
"version": "4.39.3",
44
"private": true,
55
"description": "CodeQL action",
66
"scripts": {

‎pr-checks/bundle-changelog.test.ts‎

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ import { afterEach, beforeEach, describe, it } from "node:test";
1010

1111
import {
1212
CLI_VERSION_ENV_VAR,
13+
getChangenote,
1314
getCLIVersion,
1415
getPRNumber,
1516
getPRUrl,
1617
PR_URL_ENV_VAR,
17-
updateChangelog,
1818
} from "./bundle-changelog";
19-
import {
20-
EMPTY_CHANGELOG,
21-
NO_CHANGES_STR,
22-
UNRELEASED_PLACEHOLDER,
23-
} from "./changelog";
19+
import { isValidChangenoteContent } from "./changelog/validate";
2420

2521
let testDir: string;
2622

@@ -85,58 +81,15 @@ describe("getPRNumber", async () => {
8581
});
8682
});
8783

88-
const testChangelog = `${EMPTY_CHANGELOG.trimEnd()}
89-
90-
## 4.23.7
91-
92-
- Other change
93-
94-
## 4.23.6
95-
96-
${NO_CHANGES_STR}`;
97-
98-
const expectedChangelog = `# CodeQL Action Changelog
99-
100-
## ${UNRELEASED_PLACEHOLDER}
101-
102-
- Update default CodeQL bundle version to
103-
104-
## 4.23.7
105-
106-
- Other change
107-
108-
## 4.23.6
109-
110-
${NO_CHANGES_STR}`;
111-
112-
describe("updateChangelog", async () => {
113-
await it("removes `NO_CHANGES_STR` if present in [UNRELEASED] section", async () => {
114-
const result = updateChangelog(EMPTY_CHANGELOG, "");
115-
assert.ok(!result.includes(NO_CHANGES_STR));
116-
});
117-
118-
await it("doesn't remove `NO_CHANGES_STR` if present in versioned section", async () => {
119-
const result = updateChangelog(
120-
EMPTY_CHANGELOG.replace(UNRELEASED_PLACEHOLDER, "1.2.3"),
121-
"",
84+
describe("getChangenote", async () => {
85+
await it("returns a note linking to the bundle release and the PR", async () => {
86+
assert.equal(
87+
getChangenote("1.2.3", testPrUrl),
88+
"- Update default CodeQL bundle version to [1.2.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v1.2.3). [#42](https://github.com/github/codeql-action/pulls/42)\n",
12289
);
123-
assert.ok(result.includes(NO_CHANGES_STR));
124-
});
125-
126-
await it("throws if there are no sections", async () => {
127-
assert.throws(() => {
128-
updateChangelog(
129-
"# CodeQL Action Changelog",
130-
"- Update default CodeQL bundle version to",
131-
);
132-
});
13390
});
13491

135-
await it("adds note at the end of the first section", async () => {
136-
const result = updateChangelog(
137-
testChangelog,
138-
"- Update default CodeQL bundle version to",
139-
);
140-
assert.deepEqual(result, expectedChangelog);
92+
await it("returns valid changenote content", async () => {
93+
assert.ok(isValidChangenoteContent(getChangenote("1.2.3", testPrUrl)));
14194
});
14295
});

‎pr-checks/bundle-changelog.ts‎

Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
#!/usr/bin/env npx tsx
22

33
/**
4-
* Updates the changelog with a change note for an updated CodeQL CLI bundle.
4+
* Creates a changenote file for an update to the default CodeQL CLI bundle.
55
*/
66

77
import * as fs from "node:fs";
8+
import * as path from "node:path";
89

9-
import {
10-
parseChangelog,
11-
renderChangelog,
12-
UNRELEASED_PLACEHOLDER,
13-
} from "./changelog";
14-
import { CHANGELOG_FILE, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
10+
import { CHANGENOTES_DIR, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
1511
import { getErrorMessage } from "./util";
1612

1713
export const CLI_VERSION_ENV_VAR = "CLI_VERSION";
@@ -58,65 +54,39 @@ export function getPRNumber(prUrl: string) {
5854
}
5955

6056
/**
61-
* Updates `changelog` by adding `changelogNote` to the first section.
57+
* Returns the contents of the changenote file for an update to the default
58+
* CodeQL CLI bundle.
6259
*
63-
* @param contents The existing changelog contents.
64-
* @param changelogNote The note to add to the first section.
60+
* @param cliVersion The CodeQL CLI version of the new default bundle.
61+
* @param prUrl The URL of the PR that updates the default bundle.
62+
* @throws If the PR number can't be determined from `prUrl`.
6563
*/
66-
export function updateChangelog(contents: string, changelogNote: string) {
67-
// If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
68-
contents = contents.replace(
69-
`## ${UNRELEASED_PLACEHOLDER}\n\nNo user facing changes.`,
70-
`## ${UNRELEASED_PLACEHOLDER}\n`,
71-
);
64+
export function getChangenote(cliVersion: string, prUrl: string): string {
65+
// The GitHub Release for the new bundle version.
66+
const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
7267

73-
const changelog = parseChangelog(contents);
74-
75-
if (changelog.sections.length === 0) {
76-
throw new Error("The changelog contains no existing sections.");
77-
}
78-
79-
// Add the changelog note to the bottom of the first section.
80-
const firstSection = changelog.sections[0];
81-
const lastLine = firstSection.bodyLines.pop();
82-
83-
if (lastLine !== undefined && lastLine.trim() !== "") {
84-
// We expect the last line to be empty. If it isn't for some reason,
85-
// add it back.
86-
firstSection.bodyLines.push(lastLine);
87-
}
88-
89-
firstSection.bodyLines.push(changelogNote);
90-
91-
// If the last line is empty as expected, then add it back in after the new note.
92-
if (lastLine?.trim() === "") {
93-
firstSection.bodyLines.push(lastLine);
94-
}
95-
96-
return renderChangelog(changelog);
68+
const prNumber = getPRNumber(prUrl);
69+
return `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})\n`;
9770
}
9871

9972
function main() {
10073
try {
10174
const cliVersion = getCLIVersion();
10275
const prUrl = getPRUrl();
10376

104-
// The GitHub Release for the new bundle version.
105-
const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
106-
107-
// Get the PR number from the PR URL.
108-
const prNumber = getPRNumber(prUrl);
109-
const changelogNote = `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})`;
110-
111-
let changelog = fs.readFileSync(CHANGELOG_FILE, "utf-8");
112-
113-
changelog = updateChangelog(changelog, changelogNote);
114-
115-
fs.writeFileSync(CHANGELOG_FILE, changelog);
77+
// Include the CLI version in the file name so that changenotes for
78+
// different bundle updates don't conflict.
79+
const changenotePath = path.join(
80+
CHANGENOTES_DIR,
81+
`update-bundle-${cliVersion}.md`,
82+
);
83+
fs.writeFileSync(changenotePath, getChangenote(cliVersion, prUrl));
11684

11785
return 0;
11886
} catch (err) {
119-
console.error(`Failed to bundle changelog: ${getErrorMessage(err)}`);
87+
console.error(
88+
`Failed to create changenote for bundle update: ${getErrorMessage(err)}`,
89+
);
12090
return -1;
12191
}
12292
}

‎unreleased-change-notes/ghes-3-18-deprecation.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎unreleased-change-notes/macos-xcode-deprecation.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎unreleased-change-notes/remove-trap-cache-cleanup.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)