Skip to content

Commit 9e0d7b8

Browse files
authored
Merge pull request #3905 from github/update-v4.35.5-d4b485515
Merge main into releases/v4
2 parents 68bde55 + 6d7d599 commit 9e0d7b8

81 files changed

Lines changed: 78467 additions & 1090707 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codescanning-config-cli.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ env:
66
# Diff informed queries add an additional query filter which is not yet
77
# taken into account by these tests.
88
CODEQL_ACTION_DIFF_INFORMED_QUERIES: false
9-
# Specify overlay enablement manually to ensure stability around the exclude-from-incremental
10-
# query filter. Here we only enable for the default code scanning suite.
11-
CODEQL_ACTION_OVERLAY_ANALYSIS: true
12-
CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT: false
13-
CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT: true
14-
CODEQL_ACTION_OVERLAY_ANALYSIS_STATUS_CHECK: false
15-
CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS: true
169

1710
on:
1811
push:
@@ -79,33 +72,13 @@ jobs:
7972
with:
8073
version: ${{ matrix.version }}
8174

82-
# On PRs, overlay analysis may change the config that is passed to the CLI.
83-
# Therefore, we have two variants of the following test, one for PRs and one for other events.
84-
- name: Empty file (non-PR)
85-
if: github.event_name != 'pull_request'
75+
- name: Empty file
8676
uses: ./../action/.github/actions/check-codescanning-config
8777
with:
8878
expected-config-file-contents: "{}"
8979
languages: javascript
9080
tools: ${{ steps.prepare-test.outputs.tools-url }}
9181

92-
- name: Empty file (PR)
93-
if: github.event_name == 'pull_request'
94-
uses: ./../action/.github/actions/check-codescanning-config
95-
with:
96-
expected-config-file-contents: |
97-
{
98-
"query-filters": [
99-
{
100-
"exclude": {
101-
"tags": "exclude-from-incremental"
102-
}
103-
}
104-
]
105-
}
106-
languages: javascript
107-
tools: ${{ steps.prepare-test.outputs.tools-url }}
108-
10982
- name: Packs from input
11083
if: success() || failure()
11184
uses: ./../action/.github/actions/check-codescanning-config

.github/workflows/post-release-mergeback.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
echo "::endgroup::"
132132
133133
- name: Generate token
134-
uses: actions/create-github-app-token@v3.1.1
134+
uses: actions/create-github-app-token@v3.2.0
135135
id: app-token
136136
with:
137137
app-id: ${{ vars.AUTOMATION_APP_ID }}

.github/workflows/rollback-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
137137
- name: Generate token
138138
if: github.event_name == 'workflow_dispatch'
139-
uses: actions/create-github-app-token@v3.1.1
139+
uses: actions/create-github-app-token@v3.2.0
140140
id: app-token
141141
with:
142142
app-id: ${{ vars.AUTOMATION_APP_ID }}

.github/workflows/update-release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
pull-requests: write # needed to create pull request
9494
steps:
9595
- name: Generate token
96-
uses: actions/create-github-app-token@v3.1.1
96+
uses: actions/create-github-app-token@v3.2.0
9797
id: app-token
9898
with:
9999
app-id: ${{ vars.AUTOMATION_APP_ID }}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
44

5+
## 4.35.5 - 15 May 2026
6+
7+
- We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. [#3899](https://github.com/github/codeql-action/pull/3899)
8+
- For performance and accuracy reasons, [improved incremental analysis](https://github.com/github/roadmap/issues/1158) will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. [#3791](https://github.com/github/codeql-action/pull/3791)
9+
- If multiple inputs are provided for the GitHub-internal `analysis-kinds` input, only `code-scanning` will be enabled. The `analysis-kinds` input is experimental, for GitHub-internal use only, and may change without notice at any time. [#3892](https://github.com/github/codeql-action/pull/3892)
10+
- Added an experimental change which, when running a Code Scanning analysis for a PR with [improved incremental analysis](https://github.com/github/roadmap/issues/1158) enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. [#3880](https://github.com/github/codeql-action/pull/3880)
11+
512
## 4.35.4 - 07 May 2026
613

714
- Update default CodeQL bundle version to [2.25.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.4). [#3881](https://github.com/github/codeql-action/pull/3881)

analyze/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ outputs:
9595
description: The ID of the uploaded SARIF file.
9696
runs:
9797
using: node24
98-
main: "../lib/analyze-action.js"
99-
post: "../lib/analyze-action-post.js"
98+
main: "../lib/analyze-entry.js"
99+
post: "../lib/analyze-post-entry.js"

autobuild/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ inputs:
1616
required: false
1717
runs:
1818
using: node24
19-
main: '../lib/autobuild-action.js'
19+
main: '../lib/autobuild-entry.js'

build.mjs

Lines changed: 113 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { copyFile, rm, writeFile } from "node:fs/promises";
2-
import { dirname, join } from "node:path";
1+
import { copyFile, readFile, rm, writeFile } from "node:fs/promises";
2+
import { basename, dirname, join } from "node:path";
33
import { fileURLToPath } from "node:url";
44

55
import * as esbuild from "esbuild";
@@ -62,18 +62,123 @@ const onEndPlugin = {
6262
},
6363
};
6464

65+
/** The name of the virtual `entry-points` module. */
66+
const SHARED_ENTRYPOINT = "entry-points";
67+
68+
/**
69+
* This plugin finds all source files that contain action entry points.
70+
* It then generates the virtual `entry-points` module which imports all identifies files,
71+
* and re-exports their `runWrapper` functions with suitable aliases.
72+
* A tiny stub file is emitted for each Action entrypoint. Each stub imports the shared bundle
73+
* and calls the respective entry point.
74+
*
75+
* @type {esbuild.Plugin}
76+
*/
77+
const entryPointsPlugin = {
78+
name: "entry-points",
79+
setup(build) {
80+
const namespace = "actions";
81+
const actions = [];
82+
83+
const toPascal = (s) =>
84+
s.replace(/(^|-)([a-z0-9])/gi, (_, __, c) => c.toUpperCase());
85+
86+
// Find the source files containing action entry points.
87+
build.onStart(() => {
88+
const actionFiles = globSync("src/*-action{,-post}.ts");
89+
for (const actionFile of actionFiles) {
90+
const match = basename(actionFile).match(/(.*)-action(-post)?/);
91+
92+
if (match.length < 2) {
93+
throw new Error(`'${actionFile}' didn't match expected pattern.`);
94+
}
95+
96+
const actionName = match[1];
97+
const isPost = match[2] !== undefined;
98+
99+
actions.push({
100+
path: actionFile,
101+
name: actionName,
102+
isPost,
103+
pascalCaseName: `${toPascal(actionName)}${isPost ? "Post" : ""}Action`,
104+
});
105+
}
106+
});
107+
108+
// Resolve the virtual `entry-points` file and set the corresponding namespace.
109+
// Ideally, we'd `RegExp.escape` the entrypoint here, but that API isn't supported in Node 20.
110+
// Since we're dealing with a hardcoded string, this isn't too much of a problem.
111+
build.onResolve({ filter: new RegExp(`^${SHARED_ENTRYPOINT}$`) }, () => {
112+
return { path: SHARED_ENTRYPOINT, namespace };
113+
});
114+
115+
// Generate the virtual `entry-points` file based on the actions we discovered.
116+
// Restrict using the namespace. The path filter does not need to discriminate any further.
117+
build.onLoad({ filter: /.*/, namespace }, async () => {
118+
const wrapperTemplatePath = "entry-wrapper.js.tpl";
119+
const wrapperTemplate = await readFile(
120+
join(SRC_DIR, wrapperTemplatePath),
121+
"utf-8",
122+
);
123+
124+
const actionsSorted = actions.sort((a, b) =>
125+
a.name.localeCompare(b.name),
126+
);
127+
const imports = actionsSorted
128+
.map(
129+
(action) =>
130+
`import * as ${action.pascalCaseName} from "./src/${basename(action.path)}"`,
131+
)
132+
.join("\n");
133+
const wrappers = actionsSorted
134+
.map((action) =>
135+
wrapperTemplate.replaceAll("__ACTION__", action.pascalCaseName),
136+
)
137+
.join("\n\n");
138+
139+
return {
140+
contents: `"use strict";\n${imports}\n\n${wrappers}\n`,
141+
resolveDir: ".",
142+
loader: "ts",
143+
};
144+
});
145+
146+
// Emit entry point stubs for each action using the entry template.
147+
build.onEnd(async (result) => {
148+
// Read the entry point template.
149+
const templatePath = "action-entry.js.tpl";
150+
const template = await readFile(join(SRC_DIR, templatePath), "utf-8");
151+
152+
const makeHeader = (sourceFile) =>
153+
`// Automatically generated from '${templatePath}' for 'src/${basename(sourceFile)}'.\n\n`;
154+
155+
// Write entry point stubs for each action.
156+
for (const action of actions) {
157+
await writeFile(
158+
join(
159+
OUT_DIR,
160+
`${action.name}${action.isPost ? "-post" : ""}-entry.js`,
161+
),
162+
makeHeader(action.path) +
163+
template.replaceAll("__ACTION__", action.pascalCaseName),
164+
);
165+
}
166+
});
167+
},
168+
};
169+
65170
const context = await esbuild.context({
66171
// Include upload-lib.ts as an entry point for use in testing environments.
67-
entryPoints: globSync([
68-
`${SRC_DIR}/*-action.ts`,
69-
`${SRC_DIR}/*-action-post.ts`,
70-
"src/upload-lib.ts",
71-
]),
172+
entryPoints: [
173+
{ in: SHARED_ENTRYPOINT, out: SHARED_ENTRYPOINT },
174+
join(SRC_DIR, "upload-lib.ts"),
175+
],
72176
bundle: true,
73177
format: "cjs",
74178
outdir: OUT_DIR,
75179
platform: "node",
76-
plugins: [cleanPlugin, copyDefaultsPlugin, onEndPlugin],
180+
external: ["./entry-points"],
181+
plugins: [cleanPlugin, copyDefaultsPlugin, entryPointsPlugin, onEndPlugin],
77182
target: ["node20"],
78183
define: {
79184
__CODEQL_ACTION_VERSION__: JSON.stringify(pkg.version),

init/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,5 @@ outputs:
171171
description: The version of the CodeQL binary used for analysis
172172
runs:
173173
using: node24
174-
main: '../lib/init-action.js'
175-
post: '../lib/init-action-post.js'
174+
main: '../lib/init-entry.js'
175+
post: '../lib/init-post-entry.js'

0 commit comments

Comments
 (0)