| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,13 +6,6 @@ env: | |||
| 6 | 6 | # Diff informed queries add an additional query filter which is not yet | |
| 7 | 7 | # taken into account by these tests. | |
| 8 | 8 | 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 | ||
| 16 | 9 | ||
| 17 | 10 | on: | |
| 18 | 11 | push: | |
@@ -79,33 +72,13 @@ jobs: | |||
| 79 | 72 | with: | |
| 80 | 73 | version: ${{ matrix.version }} | |
| 81 | 74 | ||
| 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 | ||
| 86 | 76 | uses: ./../action/.github/actions/check-codescanning-config | |
| 87 | 77 | with: | |
| 88 | 78 | expected-config-file-contents: "{}" | |
| 89 | 79 | languages: javascript | |
| 90 | 80 | tools: ${{ steps.prepare-test.outputs.tools-url }} | |
| 91 | 81 | ||
| 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 | - | ||
| 109 | 82 | - name: Packs from input | |
| 110 | 83 | if: success() || failure() | |
| 111 | 84 | uses: ./../action/.github/actions/check-codescanning-config | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -131,7 +131,7 @@ jobs: | |||
| 131 | 131 | echo "::endgroup::" | |
| 132 | 132 | ||
| 133 | 133 | - name: Generate token | |
| 134 | - uses: actions/create-github-app-token@v3.1.1 | ||
| 134 | + uses: actions/create-github-app-token@v3.2.0 | ||
| 135 | 135 | id: app-token | |
| 136 | 136 | with: | |
| 137 | 137 | app-id: ${{ vars.AUTOMATION_APP_ID }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -136,7 +136,7 @@ jobs: | |||
| 136 | 136 | ||
| 137 | 137 | - name: Generate token | |
| 138 | 138 | 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 | ||
| 140 | 140 | id: app-token | |
| 141 | 141 | with: | |
| 142 | 142 | app-id: ${{ vars.AUTOMATION_APP_ID }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,7 +93,7 @@ jobs: | |||
| 93 | 93 | pull-requests: write # needed to create pull request | |
| 94 | 94 | steps: | |
| 95 | 95 | - name: Generate token | |
| 96 | - uses: actions/create-github-app-token@v3.1.1 | ||
| 96 | + uses: actions/create-github-app-token@v3.2.0 | ||
| 97 | 97 | id: app-token | |
| 98 | 98 | with: | |
| 99 | 99 | app-id: ${{ vars.AUTOMATION_APP_ID }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,13 @@ | |||
| 2 | 2 | ||
| 3 | 3 | See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs. | |
| 4 | 4 | ||
| 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 | + | ||
| 5 | 12 | ## 4.35.4 - 07 May 2026 | |
| 6 | 13 | ||
| 7 | 14 | - 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) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,5 +95,5 @@ outputs: | |||
| 95 | 95 | description: The ID of the uploaded SARIF file. | |
| 96 | 96 | runs: | |
| 97 | 97 | 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" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,4 +16,4 @@ inputs: | |||
| 16 | 16 | required: false | |
| 17 | 17 | runs: | |
| 18 | 18 | using: node24 | |
| 19 | - main: '../lib/autobuild-action.js' | ||
| 19 | + main: '../lib/autobuild-entry.js' | ||
| Original file line number | Diff line number | Diff 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"; | ||
| 3 | 3 | import { fileURLToPath } from "node:url"; | |
| 4 | 4 | ||
| 5 | 5 | import * as esbuild from "esbuild"; | |
@@ -62,18 +62,123 @@ const onEndPlugin = { | |||
| 62 | 62 | }, | |
| 63 | 63 | }; | |
| 64 | 64 | ||
| 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 | + | ||
| 65 | 170 | const context = await esbuild.context({ | |
| 66 | 171 | // 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 | + ], | ||
| 72 | 176 | bundle: true, | |
| 73 | 177 | format: "cjs", | |
| 74 | 178 | outdir: OUT_DIR, | |
| 75 | 179 | platform: "node", | |
| 76 | - plugins: [cleanPlugin, copyDefaultsPlugin, onEndPlugin], | ||
| 180 | + external: ["./entry-points"], | ||
| 181 | + plugins: [cleanPlugin, copyDefaultsPlugin, entryPointsPlugin, onEndPlugin], | ||
| 77 | 182 | target: ["node20"], | |
| 78 | 183 | define: { | |
| 79 | 184 | __CODEQL_ACTION_VERSION__: JSON.stringify(pkg.version), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,5 +171,5 @@ outputs: | |||
| 171 | 171 | description: The version of the CodeQL binary used for analysis | |
| 172 | 172 | runs: | |
| 173 | 173 | 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' | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments