mirror of
https://github.com/github/codeql-action.git
synced 2026-11-04 03:59:41 +00:00
Compare commits
322 Commits
default-se
...
v3.39.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3d1b77a1b | ||
|
|
d94ff1d794 | ||
|
|
4c53ff5ddf | ||
|
|
cbf5ab6130 | ||
|
|
733fb50a06 | ||
|
|
8acbf738b2 | ||
|
|
4bfa242aa4 | ||
|
|
fca87a63d4 | ||
|
|
bc3fac49cf | ||
|
|
2bdfb07d33 | ||
|
|
bfa15a230a | ||
|
|
6f8ca3e0c5 | ||
|
|
71fd480d3c | ||
|
|
ce5e7eeac3 | ||
|
|
67cc5f0aac | ||
|
|
c157d4497c | ||
|
|
adb09ff87a | ||
|
|
e8f64d6fac | ||
|
|
c823e5d850 | ||
|
|
9f759ee644 | ||
|
|
472ce8f9d0 | ||
|
|
9c17bbcb81 | ||
|
|
1d986a146a | ||
|
|
1720989ad1 | ||
|
|
45d97c3a6c | ||
|
|
1190a975f9 | ||
|
|
a09a142526 | ||
|
|
aa62ed54ed | ||
|
|
aca72b1c31 | ||
|
|
259e857114 | ||
|
|
37fc051b5d | ||
|
|
3ea06614da | ||
|
|
39e5c2d42c | ||
|
|
d7512d4cfe | ||
|
|
41500c6922 | ||
|
|
693d869c25 | ||
|
|
dc38ccb025 | ||
|
|
faaca9a8f6 | ||
|
|
3490969653 | ||
|
|
ce74b7377b | ||
|
|
739ee7214d | ||
|
|
a3c61c3ab4 | ||
|
|
16e21b98bd | ||
|
|
6f5948dfac | ||
|
|
2907452324 | ||
|
|
a4f1d2dfeb | ||
|
|
a87239a309 | ||
|
|
c68e6e8e04 | ||
|
|
65e1329896 | ||
|
|
42947a3404 | ||
|
|
771aacb2ad | ||
|
|
0692998c5c | ||
|
|
57a845ca5d | ||
|
|
2b5f0e6784 | ||
|
|
77571dc418 | ||
|
|
f3712979fa | ||
|
|
2a073c8c9a | ||
|
|
5f47b57df6 | ||
|
|
272e6d3b25 | ||
|
|
4da5eae9f4 | ||
|
|
8b2ec470a0 | ||
|
|
c4dd10e44a | ||
|
|
2ba473f582 | ||
|
|
b4d147f9bc | ||
|
|
f6580d2b8f | ||
|
|
5e7686d132 | ||
|
|
324dd69df0 | ||
|
|
200d550080 | ||
|
|
e60ea984bd | ||
|
|
01b30f9112 | ||
|
|
f44d029dbc | ||
|
|
a7b3986136 | ||
|
|
5667eabe3b | ||
|
|
2c538e6403 | ||
|
|
fa3b8d4aca | ||
|
|
85722ca3f8 | ||
|
|
93539ac81b | ||
|
|
a2225dced3 | ||
|
|
4d950cddc8 | ||
|
|
b7ae332965 | ||
|
|
a2983b8bed | ||
|
|
30d6d12c17 | ||
|
|
14e2e60bf8 | ||
|
|
5d3f01e177 | ||
|
|
3f405c7726 | ||
|
|
19d11a3383 | ||
|
|
4187e74d05 | ||
|
|
ae71ce6a2d | ||
|
|
d2305d0114 | ||
|
|
994a21a0b3 | ||
|
|
0c52f3f086 | ||
|
|
933494d539 | ||
|
|
08d09a53f0 | ||
|
|
74406f0856 | ||
|
|
8dfbacbba5 | ||
|
|
ab2931b320 | ||
|
|
c87e7fae54 | ||
|
|
5a1ba3bdf6 | ||
|
|
b7351df727 | ||
|
|
27e669d3d6 | ||
|
|
1138fefa2b | ||
|
|
3fa858af16 | ||
|
|
4b646a0e5d | ||
|
|
44c5914b66 | ||
|
|
0d531cfd92 | ||
|
|
02c5e83432 | ||
|
|
af1b30ee40 | ||
|
|
530c909a55 | ||
|
|
0507814306 | ||
|
|
157d34d3cf | ||
|
|
b8c8426f7c | ||
|
|
411c4c9a36 | ||
|
|
6153c156f7 | ||
|
|
66185e671d | ||
|
|
51edd47ebb | ||
|
|
a90bc064bf | ||
|
|
ac8484ec8f | ||
|
|
dd903d2e4f | ||
|
|
0d313a3b02 | ||
|
|
ee98575270 | ||
|
|
7d9a983ed4 | ||
|
|
6016976cee | ||
|
|
72c906de81 | ||
|
|
d77b13a0df | ||
|
|
e816d2e818 | ||
|
|
b6eff7b44a | ||
|
|
3b37ae1c9b | ||
|
|
2587a4beb2 | ||
|
|
c02b552b1a | ||
|
|
03e4368ac7 | ||
|
|
bc887cab05 | ||
|
|
a9739a6bf0 | ||
|
|
2be5c61e31 | ||
|
|
9b64c8b76e | ||
|
|
c45c87a4c5 | ||
|
|
458d36d7d4 | ||
|
|
70a1165f9a | ||
|
|
4b79f1ba10 | ||
|
|
b2dd803f6e | ||
|
|
0e6a98bb2f | ||
|
|
cb4dbcd837 | ||
|
|
cad7075882 | ||
|
|
7fd177fa68 | ||
|
|
ea18e99ca3 | ||
|
|
19f4654991 | ||
|
|
8f15c6f1ad | ||
|
|
349cedea3b | ||
|
|
f0ffd5714c | ||
|
|
0daab03d71 | ||
|
|
30f0c9d081 | ||
|
|
3530cdd15e | ||
|
|
8280251823 | ||
|
|
e511c7b2e0 | ||
|
|
50052a22af | ||
|
|
ce64ddcb0d | ||
|
|
c186c7b484 | ||
|
|
8bcc8f23a2 | ||
|
|
834786ac9b | ||
|
|
047c547345 | ||
|
|
7ca215887b | ||
|
|
5c8a8a642e | ||
|
|
646729a1e2 | ||
|
|
c983cb8e74 | ||
|
|
557b58c47c | ||
|
|
8bb5bdb9fd | ||
|
|
4d2fde9e07 | ||
|
|
13efb23391 | ||
|
|
b1a5f00cf1 | ||
|
|
124f6eec3b | ||
|
|
a88fb3cde0 | ||
|
|
57d591c67c | ||
|
|
dba1849cf2 | ||
|
|
ebcb5b36de | ||
|
|
97fd992228 | ||
|
|
95a562052b | ||
|
|
ae8b37eb31 | ||
|
|
d75030c604 | ||
|
|
a777590c0f | ||
|
|
dfad8f8ebc | ||
|
|
c146cd2193 | ||
|
|
3fef31e9b5 | ||
|
|
3d7478b23a | ||
|
|
f874badee7 | ||
|
|
1c3843e226 | ||
|
|
603b797f8b | ||
|
|
9ed0d758ce | ||
|
|
2da877a512 | ||
|
|
4ccf9a5deb | ||
|
|
e50ab6dc1d | ||
|
|
ee6db5e4f5 | ||
|
|
820e3160e2 | ||
|
|
dabb34c95a | ||
|
|
c0e7770e36 | ||
|
|
dbc2ac9b7a | ||
|
|
e61b8b4cf5 | ||
|
|
b7ebceaf1a | ||
|
|
ae9ef3a1d2 | ||
|
|
b58ecf644d | ||
|
|
e3632d0ee3 | ||
|
|
cdcb071e67 | ||
|
|
177cb24be1 | ||
|
|
2427cfc4a9 | ||
|
|
45580472a5 | ||
|
|
a3696cdbdf | ||
|
|
147ec67ee5 | ||
|
|
acb91bd91f | ||
|
|
88d9aba91d | ||
|
|
72edeaa05b | ||
|
|
f5c2471be7 | ||
|
|
70a71a57dd | ||
|
|
676a1ceb5c | ||
|
|
e127ec2647 | ||
|
|
f5e6f52190 | ||
|
|
e2a90d3e23 | ||
|
|
b5ebac6f4c | ||
|
|
bb159524f9 | ||
|
|
6b68dd5d27 | ||
|
|
24e739f51f | ||
|
|
e5a63de15c | ||
|
|
c2d57b0fc7 | ||
|
|
2588666de8 | ||
|
|
fd13ffa22c | ||
|
|
ce04bc5815 | ||
|
|
27eb5f56eb | ||
|
|
44f67f0887 | ||
|
|
5d24c86a89 | ||
|
|
439137e1b5 | ||
|
|
f5ab452606 | ||
|
|
56c8e1c8a8 | ||
|
|
4f5ca6f9a5 | ||
|
|
92f3a2822b | ||
|
|
e9bf22fb0e | ||
|
|
38e701f46e | ||
|
|
c9e0329cc4 | ||
|
|
9ffacc75e8 | ||
|
|
21961f3b6f | ||
|
|
8233700206 | ||
|
|
23e84a39f0 | ||
|
|
4bdb89f480 | ||
|
|
ed629463c0 | ||
|
|
6252d140cd | ||
|
|
84cf4b44bb | ||
|
|
52cebb523a | ||
|
|
fc6e643fe1 | ||
|
|
f8ee3fcc9a | ||
|
|
45c373516f | ||
|
|
311b632b9d | ||
|
|
d300581d5e | ||
|
|
7348876640 | ||
|
|
4f34645a82 | ||
|
|
e7c7a2d323 | ||
|
|
f47c8e6a9b | ||
|
|
74951318a2 | ||
|
|
5676d1f64a | ||
|
|
c1bea80e56 | ||
|
|
2d9c0b97af | ||
|
|
827017f97b | ||
|
|
bffd034ab1 | ||
|
|
817dbfb39b | ||
|
|
793f7006bb | ||
|
|
d2e9832330 | ||
|
|
c2e4b7785f | ||
|
|
66d7f51a10 | ||
|
|
497990dfed | ||
|
|
89cb79a131 | ||
|
|
dbf6819ebd | ||
|
|
5af51f4048 | ||
|
|
e439418aab | ||
|
|
249860e323 | ||
|
|
d3ced5c96c | ||
|
|
c12d7c1f2d | ||
|
|
2e2a1cf1ef | ||
|
|
e2cca77d06 | ||
|
|
801a18bea6 | ||
|
|
1c715a714c | ||
|
|
c3d42c5d08 | ||
|
|
9031cd9330 | ||
|
|
f58938aee2 | ||
|
|
1f1c162805 | ||
|
|
7ab96a0e6f | ||
|
|
e3cb86275a | ||
|
|
f94c9befff | ||
|
|
e5971bdba6 | ||
|
|
c5a9d29dc9 | ||
|
|
9f1109665d | ||
|
|
f8f60f3a2b | ||
|
|
f4d10b9ef7 | ||
|
|
5d5cd550d3 | ||
|
|
c6eb09db21 | ||
|
|
09db9044dc | ||
|
|
d3cd47d8d6 | ||
|
|
8e9caa5100 | ||
|
|
23a6333b88 | ||
|
|
c503cb4fbb | ||
|
|
c2805e0a04 | ||
|
|
c0d3370b54 | ||
|
|
ddd0dc746a | ||
|
|
2f607936ce | ||
|
|
37e7dfbaa0 | ||
|
|
d198d2fabf | ||
|
|
9e3918e481 | ||
|
|
7dd1575dac | ||
|
|
28fc48d83c | ||
|
|
12c6008004 | ||
|
|
d3019effb0 | ||
|
|
42213152a8 | ||
|
|
e677e67801 | ||
|
|
5f3f3164ad | ||
|
|
ba42101490 | ||
|
|
f11af5849b | ||
|
|
ba5430dc86 | ||
|
|
13e883e119 | ||
|
|
755f44910c | ||
|
|
948223fe01 | ||
|
|
a37add20d4 | ||
|
|
ab163cf08b | ||
|
|
319796f085 | ||
|
|
bd1ac56295 | ||
|
|
a8d1ac45b9 | ||
|
|
c551c50310 | ||
|
|
01f1a24033 | ||
|
|
b264e15259 |
2
.github/actions/check-sarif/action.yml
vendored
2
.github/actions/check-sarif/action.yml
vendored
@@ -16,5 +16,5 @@ inputs:
|
||||
Comma separated list of query ids that should NOT be included in this SARIF file.
|
||||
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: index.js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: Verify that the best-effort debug artifact scan completed
|
||||
description: Verifies that the best-effort debug artifact scan completed successfully during tests
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: index.js
|
||||
post: post.js
|
||||
|
||||
2
.github/workflows/__unsupported-macos.yml
generated
vendored
2
.github/workflows/__unsupported-macos.yml
generated
vendored
@@ -114,7 +114,7 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Download workflow artifact
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: test-mode-sarif-*
|
||||
path: sarif
|
||||
|
||||
7
.github/workflows/update-bundle.yml
vendored
7
.github/workflows/update-bundle.yml
vendored
@@ -113,12 +113,11 @@ jobs:
|
||||
echo "CLI_VERSION=$cli_version" | tee -a "$GITHUB_ENV"
|
||||
echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV"
|
||||
|
||||
- name: Create changenote
|
||||
- name: Create changelog note
|
||||
run: |
|
||||
npx tsx pr-checks/bundle-changelog.ts
|
||||
|
||||
- name: Push changenote
|
||||
- name: Push changelog note
|
||||
run: |
|
||||
git add unreleased-change-notes
|
||||
git commit -m "Add changenote"
|
||||
git commit -am "Add changelog note"
|
||||
git push
|
||||
|
||||
110
CHANGELOG.md
110
CHANGELOG.md
@@ -2,124 +2,120 @@
|
||||
|
||||
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.39.2 - 03 Nov 2026
|
||||
## 3.39.2 - 03 Nov 2026
|
||||
|
||||
- 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)
|
||||
- _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)
|
||||
- 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)
|
||||
- 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)
|
||||
|
||||
## 4.39.1 - 21 Oct 2026
|
||||
## 3.39.1 - 21 Oct 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.27.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.3). [#4256](https://github.com/github/codeql-action/pull/4256)
|
||||
|
||||
## 4.39.0 - 15 Oct 2026
|
||||
## 3.39.0 - 15 Oct 2026
|
||||
|
||||
- _Breaking change_: Bump the minimum required CodeQL bundle version to 2.20.7. [#4205](https://github.com/github/codeql-action/pull/4205)
|
||||
- The `codeql-action/analyze` step now validates that a correct argument for the `checkout_path` input has been provided. The `checkout_path` input must be set to the path where the repository that is being analyzed is checked out at on the runner, if that path is something other than the workspace root. If the path does not point to a repository checkout or is different from the path that was used by `codeql-action/init`, then the CodeQL Action now produces a warning. [#4148](https://github.com/github/codeql-action/pull/4148)
|
||||
- Resolved an issue with third-party caching implementations that prevented caches from being restored correctly. [#4206](https://github.com/github/codeql-action/pull/4206)
|
||||
- The `codeql-action/start-proxy` step that is used in Code Scanning Default Setup now finds CodeQL releases using the same logic as `codeql-action/init`. This primarily benefits customers who are using GitHub instances other than `github.com` where the `codeql-action/start-proxy` step may previously have been unable to locate recent releases and ended up using outdated versions of the private registry authentication proxy as a result. [#4198](https://github.com/github/codeql-action/pull/4198)
|
||||
|
||||
## 4.38.3 - 08 Oct 2026
|
||||
## 3.38.3 - 08 Oct 2026
|
||||
|
||||
- _Upcoming breaking change_: CodeQL version 2.21.2 and earlier were discontinued on 24 September 2026 alongside GitHub Enterprise Server 3.17, and will be unsupported by the next minor release of the CodeQL Action. Added a deprecation warning for customers using these versions of CodeQL. [#4188](https://github.com/github/codeql-action/pull/4188)
|
||||
- Update default CodeQL bundle version to [2.27.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.2). [#4203](https://github.com/github/codeql-action/pull/4203)
|
||||
- Fixed a bug where the decision of whether to use a per-language bundle did not account for custom configurations that reference queries outside of compiled CodeQL packs. This issue was caught during internal testing and did not affect any customer repositories. We will resume the roll out of per-language bundles in the coming weeks. [#4184](https://github.com/github/codeql-action/pull/4184)
|
||||
|
||||
## 4.38.2 - 24 Sept 2026
|
||||
## 3.38.2 - 24 Sept 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.27.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.1). [#4160](https://github.com/github/codeql-action/pull/4160)
|
||||
|
||||
## 4.38.1 - 18 Sept 2026
|
||||
## 3.38.1 - 18 Sept 2026
|
||||
|
||||
- The CodeQL Action now has experimental support for CodeQL releases for which per-language bundles are available. Per-language bundles support analysis for a single language and are therefore smaller than the combined bundles that allow analysis for all supported languages. As a result, per-language bundles take up less space on disk and are faster to download. We expect to roll this change out to everyone in the coming weeks. [#4146](https://github.com/github/codeql-action/pull/4146)
|
||||
|
||||
## 4.38.0 - 09 Sept 2026
|
||||
## 3.38.0 - 09 Sept 2026
|
||||
|
||||
- On GitHub-hosted runners, the CodeQL Action now deletes unused CodeQL bundles from the toolcache before downloading a different bundle, which frees up disk space for the analysis. We expect to roll this change out to everyone in September. [#4124](https://github.com/github/codeql-action/pull/4124)
|
||||
- The CodeQL Action now supports CodeQL releases that are compatible with Linux Arm64 and downloads the native `linux-arm64` CodeQL bundle when available. [#4072](https://github.com/github/codeql-action/pull/4072)
|
||||
- Update default CodeQL bundle version to [2.27.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.0). [#4129](https://github.com/github/codeql-action/pull/4129)
|
||||
|
||||
## 4.37.9 - 26 Aug 2026
|
||||
## 3.37.9 - 26 Aug 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.26.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.4). [#4106](https://github.com/github/codeql-action/pull/4106)
|
||||
|
||||
## 4.37.8 - 21 Aug 2026
|
||||
## 3.37.8 - 21 Aug 2026
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.37.7 - 13 Aug 2026
|
||||
## 3.37.7 - 13 Aug 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.26.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.3). [#4085](https://github.com/github/codeql-action/pull/4085)
|
||||
|
||||
## 4.37.6 - 04 Aug 2026
|
||||
## 3.37.6 - 04 Aug 2026
|
||||
|
||||
- Changed the default filepath for the new remote file address format that was introduced in CodeQL Action 4.37.0 / 3.37.0 to `.github/codeql-config.yml` to align it with the suggested path that is used elsewhere. [#4070](https://github.com/github/codeql-action/pull/4070)
|
||||
|
||||
## 4.37.5 - 03 Aug 2026
|
||||
## 3.37.5 - 03 Aug 2026
|
||||
|
||||
- Fixed a bug where a network error while streaming the download of the CodeQL bundle could terminate the `init` Action instead of falling back to downloading the bundle before extracting it. [#4061](https://github.com/github/codeql-action/pull/4061)
|
||||
|
||||
## 4.37.4 - 29 Jul 2026
|
||||
## 3.37.4 - 29 Jul 2026
|
||||
|
||||
- This version of the CodeQL Action adds support for the `tools` input for the `codeql-action/init` step to be specified using a `github-codeql-tools` [repository property](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature will gradually be rolled out following the release of this version. Once rolled out, this allows for the CodeQL CLI version that is used in GitHub-managed workflows, such as Default Setup, to be set to a custom value. For example, customers who run into issues with rate limits when a new CodeQL CLI version is released can set the value to `toolcache` to always use the CodeQL CLI version that is available in the runner toolcache. For Advanced Setup workflows, the value provided for `tools` in the workflow definition always takes precedence unless the value of the repository property starts with `!`. [#4037](https://github.com/github/codeql-action/pull/4037)
|
||||
- Update default CodeQL bundle version to [2.26.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.2). [#4051](https://github.com/github/codeql-action/pull/4051)
|
||||
|
||||
## 4.37.3 - 22 Jul 2026
|
||||
## 3.37.3 - 22 Jul 2026
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.37.2 - 21 Jul 2026
|
||||
## 3.37.2 - 21 Jul 2026
|
||||
|
||||
- The new address format for the `config-file` input that was introduced in CodeQL Action 4.37.0 is now enabled by default. In addition to the format described there, the `remote=` prefix can now be used to explicitly indicate that the input refers to a remote file. All previous input formats continue to be accepted as well. [#4023](https://github.com/github/codeql-action/pull/4023)
|
||||
- The CodeQL Action can now make use of [configured private registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) in Default Setup to retrieve CodeQL configuration files from remote repositories that require authentication. This will allow customers to store their CodeQL configuration in a single repository that can then be referenced by Default Setup workflows in other repositories. We expect to roll this and other, related changes out to everyone in July. [#4007](https://github.com/github/codeql-action/pull/4007)
|
||||
|
||||
## 4.37.1 - 16 Jul 2026
|
||||
## 3.37.1 - 16 Jul 2026
|
||||
|
||||
- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.20.6 and earlier. These versions of CodeQL were discontinued on 1 July 2026 alongside GitHub Enterprise Server 3.16, and will be unsupported by the next minor release of the CodeQL Action. [#3956](https://github.com/github/codeql-action/pull/3956)
|
||||
- Update default CodeQL bundle version to [2.26.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.1). [#4019](https://github.com/github/codeql-action/pull/4019)
|
||||
|
||||
## 4.37.0 - 08 Jul 2026
|
||||
## 3.37.0 - 08 Jul 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.26.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.0). [#3995](https://github.com/github/codeql-action/pull/3995)
|
||||
- In addition to the existing input format, the `config-file` input for the `codeql-action/init` step will soon support a new `[owner/]repo[@ref][:path]` format. All components except the repository name are optional. If omitted, `owner` defaults to the same owner as the repository the analysis is running for, `ref` to `main`, and `path` to `.github/codeql-action.yaml`. Support for this format ships in this version of the CodeQL Action, but will only be enabled over the coming weeks. [#3973](https://github.com/github/codeql-action/pull/3973)
|
||||
|
||||
## 4.36.3 - 01 Jul 2026
|
||||
## 3.36.3 - 01 Jul 2026
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.36.2 - 04 Jun 2026
|
||||
## 3.36.2 - 04 Jun 2026
|
||||
|
||||
- Cache CodeQL CLI version information across Actions steps. [#3943](https://github.com/github/codeql-action/pull/3943)
|
||||
- Reduce requests while waiting for analysis processing by using exponential backoff when polling SARIF processing status. [#3937](https://github.com/github/codeql-action/pull/3937)
|
||||
- Update default CodeQL bundle version to [2.25.6](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.6). [#3948](https://github.com/github/codeql-action/pull/3948)
|
||||
|
||||
## 4.36.1 - 02 Jun 2026
|
||||
## 3.36.1 - 02 Jun 2026
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.36.0 - 22 May 2026
|
||||
## 3.36.0 - 22 May 2026
|
||||
|
||||
- _Breaking change_: Bump the minimum required CodeQL bundle version to 2.19.4. [#3894](https://github.com/github/codeql-action/pull/3894)
|
||||
- Add support for SHA-256 Git object IDs. [#3893](https://github.com/github/codeql-action/pull/3893)
|
||||
- Update default CodeQL bundle version to [2.25.5](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.5). [#3926](https://github.com/github/codeql-action/pull/3926)
|
||||
|
||||
## 4.35.5 - 15 May 2026
|
||||
## 3.35.5 - 15 May 2026
|
||||
|
||||
- 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)
|
||||
- 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)
|
||||
- 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)
|
||||
- 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)
|
||||
|
||||
## 4.35.4 - 07 May 2026
|
||||
## 3.35.4 - 07 May 2026
|
||||
|
||||
- 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)
|
||||
|
||||
## 4.35.3 - 01 May 2026
|
||||
## 3.35.3 - 01 May 2026
|
||||
|
||||
- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. [#3837](https://github.com/github/codeql-action/pull/3837)
|
||||
- Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. [#3850](https://github.com/github/codeql-action/pull/3850)
|
||||
@@ -127,7 +123,7 @@ No user facing changes.
|
||||
- Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. [#3852](https://github.com/github/codeql-action/pull/3852)
|
||||
- Update default CodeQL bundle version to [2.25.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.3). [#3865](https://github.com/github/codeql-action/pull/3865)
|
||||
|
||||
## 4.35.2 - 15 Apr 2026
|
||||
## 3.35.2 - 15 Apr 2026
|
||||
|
||||
- The undocumented TRAP cache cleanup feature that could be enabled using the `CODEQL_ACTION_CLEANUP_TRAP_CACHES` environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action. [#3795](https://github.com/github/codeql-action/pull/3795)
|
||||
- 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)
|
||||
@@ -135,26 +131,26 @@ No user facing changes.
|
||||
- Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. [#3807](https://github.com/github/codeql-action/pull/3807)
|
||||
- Update default CodeQL bundle version to [2.25.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.2). [#3823](https://github.com/github/codeql-action/pull/3823)
|
||||
|
||||
## 4.35.1 - 27 Mar 2026
|
||||
## 3.35.1 - 27 Mar 2026
|
||||
|
||||
- Fix incorrect minimum required Git version for [improved incremental analysis](https://github.com/github/roadmap/issues/1158): it should have been 2.36.0, not 2.11.0. [#3781](https://github.com/github/codeql-action/pull/3781)
|
||||
|
||||
## 4.35.0 - 27 Mar 2026
|
||||
## 3.35.0 - 27 Mar 2026
|
||||
|
||||
- Reduced the minimum Git version required for [improved incremental analysis](https://github.com/github/roadmap/issues/1158) from 2.38.0 to 2.11.0. [#3767](https://github.com/github/codeql-action/pull/3767)
|
||||
- Update default CodeQL bundle version to [2.25.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.1). [#3773](https://github.com/github/codeql-action/pull/3773)
|
||||
|
||||
## 4.34.1 - 20 Mar 2026
|
||||
## 3.34.1 - 20 Mar 2026
|
||||
|
||||
- Downgrade default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3) due to issues with a small percentage of Actions and JavaScript analyses. [#3762](https://github.com/github/codeql-action/pull/3762)
|
||||
|
||||
## 4.34.0 - 20 Mar 2026
|
||||
## 3.34.0 - 20 Mar 2026
|
||||
|
||||
- Added an experimental change which disables TRAP caching when [improved incremental analysis](https://github.com/github/roadmap/issues/1158) is enabled, since improved incremental analysis supersedes TRAP caching. This will improve performance and reduce Actions cache usage. We expect to roll this change out to everyone in March. [#3569](https://github.com/github/codeql-action/pull/3569)
|
||||
- We are rolling out improved incremental analysis to C/C++ analyses that use build mode `none`. We expect this rollout to be complete by the end of April 2026. [#3584](https://github.com/github/codeql-action/pull/3584)
|
||||
- Update default CodeQL bundle version to [2.25.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.0). [#3585](https://github.com/github/codeql-action/pull/3585)
|
||||
|
||||
## 4.33.0 - 16 Mar 2026
|
||||
## 3.33.0 - 16 Mar 2026
|
||||
|
||||
- Upcoming change: Starting April 2026, the CodeQL Action will skip collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Pull request analyses will log a warning about this upcoming change. [#3562](https://github.com/github/codeql-action/pull/3562)
|
||||
|
||||
@@ -168,11 +164,11 @@ No user facing changes.
|
||||
- Fixed the retry mechanism for database uploads. Previously this would fail with the error "Response body object should not be disturbed or locked". [#3564](https://github.com/github/codeql-action/pull/3564)
|
||||
- A warning is now emitted if the CodeQL Action detects a repository property whose name suggests that it relates to the CodeQL Action, but which is not one of the properties recognised by the current version of the CodeQL Action. [#3570](https://github.com/github/codeql-action/pull/3570)
|
||||
|
||||
## 4.32.6 - 05 Mar 2026
|
||||
## 3.32.6 - 05 Mar 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3). [#3548](https://github.com/github/codeql-action/pull/3548)
|
||||
|
||||
## 4.32.5 - 02 Mar 2026
|
||||
## 3.32.5 - 02 Mar 2026
|
||||
|
||||
- Repositories owned by an organization can now set up the `github-codeql-disable-overlay` custom repository property to disable [improved incremental analysis for CodeQL](https://github.com/github/roadmap/issues/1158). First, create a custom repository property with the name `github-codeql-disable-overlay` and the type "True/false" in the organization's settings. Then in the repository's settings, set this property to `true` to disable improved incremental analysis. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature is not yet available on GitHub Enterprise Server. [#3507](https://github.com/github/codeql-action/pull/3507)
|
||||
- Added an experimental change so that when [improved incremental analysis](https://github.com/github/roadmap/issues/1158) fails on a runner — potentially due to insufficient disk space — the failure is recorded in the Actions cache so that subsequent runs will automatically skip improved incremental analysis until something changes (e.g. a larger runner is provisioned or a new CodeQL version is released). We expect to roll this change out to everyone in March. [#3487](https://github.com/github/codeql-action/pull/3487)
|
||||
@@ -182,7 +178,7 @@ No user facing changes.
|
||||
- Added an experimental change which allows the `start-proxy` action to resolve the CodeQL CLI version from feature flags instead of using the linked CLI bundle version. We expect to roll this change out to everyone in March. [#3512](https://github.com/github/codeql-action/pull/3512)
|
||||
- The previously experimental changes from versions 4.32.3, 4.32.4, 3.32.3 and 3.32.4 are now enabled by default. [#3503](https://github.com/github/codeql-action/pull/3503), [#3504](https://github.com/github/codeql-action/pull/3504)
|
||||
|
||||
## 4.32.4 - 20 Feb 2026
|
||||
## 3.32.4 - 20 Feb 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.24.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.2). [#3493](https://github.com/github/codeql-action/pull/3493)
|
||||
- Added an experimental change which improves how certificates are generated for the authentication proxy that is used by the CodeQL Action in Default Setup when [private package registries are configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries). This is expected to generate more widely compatible certificates and should have no impact on analyses which are working correctly already. We expect to roll this change out to everyone in February. [#3473](https://github.com/github/codeql-action/pull/3473)
|
||||
@@ -190,89 +186,89 @@ No user facing changes.
|
||||
- Added a setting which allows the CodeQL Action to enable network debugging for Java programs. This will help GitHub staff support customers with troubleshooting issues in GitHub-managed CodeQL workflows, such as Default Setup. This setting can only be enabled by GitHub staff. [#3485](https://github.com/github/codeql-action/pull/3485)
|
||||
- Added a setting which enables GitHub-managed workflows, such as Default Setup, to use a [nightly CodeQL CLI release](https://github.com/dsp-testing/codeql-cli-nightlies) instead of the latest, stable release that is used by default. This will help GitHub staff support customers whose analyses for a given repository or organization require early access to a change in an upcoming CodeQL CLI release. This setting can only be enabled by GitHub staff. [#3484](https://github.com/github/codeql-action/pull/3484)
|
||||
|
||||
## 4.32.3 - 13 Feb 2026
|
||||
## 3.32.3 - 13 Feb 2026
|
||||
|
||||
- Added experimental support for testing connections to [private package registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries). This feature is not currently enabled for any analysis. In the future, it may be enabled by default for Default Setup. [#3466](https://github.com/github/codeql-action/pull/3466)
|
||||
|
||||
## 4.32.2 - 05 Feb 2026
|
||||
## 3.32.2 - 05 Feb 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.24.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.1). [#3460](https://github.com/github/codeql-action/pull/3460)
|
||||
|
||||
## 4.32.1 - 02 Feb 2026
|
||||
## 3.32.1 - 02 Feb 2026
|
||||
|
||||
- A warning is now shown in Default Setup workflow logs if a [private package registry is configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) using a GitHub Personal Access Token (PAT), but no username is configured. [#3422](https://github.com/github/codeql-action/pull/3422)
|
||||
- Fixed a bug which caused the CodeQL Action to fail when repository properties cannot successfully be retrieved. [#3421](https://github.com/github/codeql-action/pull/3421)
|
||||
|
||||
## 4.32.0 - 26 Jan 2026
|
||||
## 3.32.0 - 26 Jan 2026
|
||||
|
||||
- Update default CodeQL bundle version to [2.24.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.0). [#3425](https://github.com/github/codeql-action/pull/3425)
|
||||
|
||||
## 4.31.11 - 23 Jan 2026
|
||||
## 3.31.11 - 23 Jan 2026
|
||||
|
||||
- When running a Default Setup workflow with [Actions debugging enabled](https://docs.github.com/en/actions/how-tos/monitor-workflows/enable-debug-logging), the CodeQL Action will now use more unique names when uploading logs from the Dependabot authentication proxy as workflow artifacts. This ensures that the artifact names do not clash between multiple jobs in a build matrix. [#3409](https://github.com/github/codeql-action/pull/3409)
|
||||
- Improved error handling throughout the CodeQL Action. [#3415](https://github.com/github/codeql-action/pull/3415)
|
||||
- Added experimental support for automatically excluding [generated files](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github) from the analysis. This feature is not currently enabled for any analysis. In the future, it may be enabled by default for some GitHub-managed analyses. [#3318](https://github.com/github/codeql-action/pull/3318)
|
||||
- The changelog extracts that are included with releases of the CodeQL Action are now shorter to avoid duplicated information from appearing in Dependabot PRs. [#3403](https://github.com/github/codeql-action/pull/3403)
|
||||
|
||||
## 4.31.10 - 12 Jan 2026
|
||||
## 3.31.10 - 12 Jan 2026
|
||||
|
||||
- Update default CodeQL bundle version to 2.23.9. [#3393](https://github.com/github/codeql-action/pull/3393)
|
||||
|
||||
## 4.31.9 - 16 Dec 2025
|
||||
## 3.31.9 - 16 Dec 2025
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.31.8 - 11 Dec 2025
|
||||
## 3.31.8 - 11 Dec 2025
|
||||
|
||||
- Update default CodeQL bundle version to 2.23.8. [#3354](https://github.com/github/codeql-action/pull/3354)
|
||||
|
||||
## 4.31.7 - 05 Dec 2025
|
||||
## 3.31.7 - 05 Dec 2025
|
||||
|
||||
- Update default CodeQL bundle version to 2.23.7. [#3343](https://github.com/github/codeql-action/pull/3343)
|
||||
|
||||
## 4.31.6 - 01 Dec 2025
|
||||
## 3.31.6 - 01 Dec 2025
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.31.5 - 24 Nov 2025
|
||||
## 3.31.5 - 24 Nov 2025
|
||||
|
||||
- Update default CodeQL bundle version to 2.23.6. [#3321](https://github.com/github/codeql-action/pull/3321)
|
||||
|
||||
## 4.31.4 - 18 Nov 2025
|
||||
## 3.31.4 - 18 Nov 2025
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.31.3 - 13 Nov 2025
|
||||
## 3.31.3 - 13 Nov 2025
|
||||
|
||||
- CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/).
|
||||
- Update default CodeQL bundle version to 2.23.5. [#3288](https://github.com/github/codeql-action/pull/3288)
|
||||
|
||||
## 4.31.2 - 30 Oct 2025
|
||||
## 3.31.2 - 30 Oct 2025
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.31.1 - 30 Oct 2025
|
||||
## 3.31.1 - 30 Oct 2025
|
||||
|
||||
- The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced.
|
||||
|
||||
## 4.31.0 - 24 Oct 2025
|
||||
## 3.31.0 - 24 Oct 2025
|
||||
|
||||
- Bump minimum CodeQL bundle version to 2.17.6. [#3223](https://github.com/github/codeql-action/pull/3223)
|
||||
- When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [#3222](https://github.com/github/codeql-action/pull/3222)
|
||||
|
||||
## 4.30.9 - 17 Oct 2025
|
||||
## 3.30.9 - 17 Oct 2025
|
||||
|
||||
- Update default CodeQL bundle version to 2.23.3. [#3205](https://github.com/github/codeql-action/pull/3205)
|
||||
- Experimental: A new `setup-codeql` action has been added which is similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. Do not use this in production as it is part of an internal experiment and subject to change at any time. [#3204](https://github.com/github/codeql-action/pull/3204)
|
||||
|
||||
## 4.30.8 - 10 Oct 2025
|
||||
## 3.30.8 - 10 Oct 2025
|
||||
|
||||
No user facing changes.
|
||||
|
||||
## 4.30.7 - 06 Oct 2025
|
||||
## 3.30.7 - 06 Oct 2025
|
||||
|
||||
- [v4+ only] The CodeQL Action now runs on Node.js v24. [#3169](https://github.com/github/codeql-action/pull/3169)
|
||||
|
||||
No user facing changes.
|
||||
## 3.30.6 - 02 Oct 2025
|
||||
|
||||
- Update default CodeQL bundle version to 2.23.2. [#3168](https://github.com/github/codeql-action/pull/3168)
|
||||
|
||||
@@ -94,6 +94,6 @@ outputs:
|
||||
sarif-id:
|
||||
description: The ID of the uploaded SARIF file.
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: "../lib/analyze-entry.js"
|
||||
post: "../lib/analyze-post-entry.js"
|
||||
|
||||
@@ -15,5 +15,5 @@ inputs:
|
||||
$GITHUB_WORKSPACE as its working directory.
|
||||
required: false
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: '../lib/autobuild-entry.js'
|
||||
|
||||
@@ -180,6 +180,6 @@ outputs:
|
||||
codeql-version:
|
||||
description: The version of the CodeQL binary used for analysis
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: '../lib/init-entry.js'
|
||||
post: '../lib/init-post-entry.js'
|
||||
|
||||
330
lib/entry-points.js
generated
330
lib/entry-points.js
generated
@@ -157611,18 +157611,10 @@ var require_cipherModes = __commonJS({
|
||||
return false;
|
||||
}
|
||||
var len = output.length();
|
||||
if (len === 0) {
|
||||
return true;
|
||||
}
|
||||
var count = output.at(len - 1);
|
||||
if (count === 0 || count > this.blockSize || count > len) {
|
||||
if (count > this.blockSize << 2) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 2; i <= count; ++i) {
|
||||
if (output.at(len - i) !== count) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
output.truncate(count);
|
||||
return true;
|
||||
};
|
||||
@@ -157684,18 +157676,10 @@ var require_cipherModes = __commonJS({
|
||||
return false;
|
||||
}
|
||||
var len = output.length();
|
||||
if (len === 0) {
|
||||
return true;
|
||||
}
|
||||
var count = output.at(len - 1);
|
||||
if (count === 0 || count > this.blockSize || count > len) {
|
||||
if (count > this.blockSize << 2) {
|
||||
return false;
|
||||
}
|
||||
for (var i = 2; i <= count; ++i) {
|
||||
if (output.at(len - i) !== count) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
output.truncate(count);
|
||||
return true;
|
||||
};
|
||||
@@ -157953,14 +157937,11 @@ var require_cipherModes = __commonJS({
|
||||
} else {
|
||||
additionalData = forge.util.createBuffer();
|
||||
}
|
||||
if (options.tagLength !== void 0 && options.tagLength !== null) {
|
||||
this._tagLength = Number(options.tagLength);
|
||||
if ("tagLength" in options) {
|
||||
this._tagLength = options.tagLength;
|
||||
} else {
|
||||
this._tagLength = 128;
|
||||
}
|
||||
if ([128, 120, 112, 104, 96, 64, 32].indexOf(this._tagLength) === -1) {
|
||||
throw new Error("Invalid tag length.");
|
||||
}
|
||||
this._tag = null;
|
||||
if (options.decrypt) {
|
||||
this._tag = forge.util.createBuffer(options.tag).getBytes();
|
||||
@@ -158911,10 +158892,7 @@ var require_asn1 = __commonJS({
|
||||
var subOptions = {
|
||||
// enforce strict mode to avoid parsing ASN.1 from plain data
|
||||
strict: true,
|
||||
// only decode one level of BIT STRINGs, nested decoding has
|
||||
// quadratic cost due to copies for change detection
|
||||
decodeBitStrings: false,
|
||||
maxDepth: options.maxDepth
|
||||
decodeBitStrings: true
|
||||
};
|
||||
var composed = _fromDer(bytes, remaining, depth + 1, subOptions);
|
||||
var used = start - bytes.length();
|
||||
@@ -159018,16 +158996,12 @@ var require_asn1 = __commonJS({
|
||||
asn1.oidToDer = function(oid) {
|
||||
var values = oid.split(".");
|
||||
var bytes = forge.util.createBuffer();
|
||||
var first = parseInt(values[0], 10);
|
||||
var second = parseInt(values[1], 10);
|
||||
if (!(first >= 0 && first <= 2 && second >= 0) || first < 2 && second > 39) {
|
||||
throw new Error("Invalid OID; the first two arcs are out of range.");
|
||||
}
|
||||
bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10));
|
||||
var last, valueBytes, value, b;
|
||||
for (var i = 1; i < values.length; ++i) {
|
||||
for (var i = 2; i < values.length; ++i) {
|
||||
last = true;
|
||||
valueBytes = [];
|
||||
value = i === 1 ? 40 * first + second : parseInt(values[i], 10);
|
||||
value = parseInt(values[i], 10);
|
||||
if (value > 4294967295) {
|
||||
throw new Error("OID value too large; max is 32-bits.");
|
||||
}
|
||||
@@ -159051,9 +159025,9 @@ var require_asn1 = __commonJS({
|
||||
if (typeof bytes === "string") {
|
||||
bytes = forge.util.createBuffer(bytes);
|
||||
}
|
||||
var b;
|
||||
var b = bytes.getByte();
|
||||
oid = Math.floor(b / 40) + "." + b % 40;
|
||||
var value = 0;
|
||||
var first = true;
|
||||
while (bytes.length() > 0) {
|
||||
if (value > 70368744177663) {
|
||||
throw new Error("OID value too large; max is 53-bits.");
|
||||
@@ -159063,13 +159037,7 @@ var require_asn1 = __commonJS({
|
||||
if (b & 128) {
|
||||
value += b & 127;
|
||||
} else {
|
||||
value += b;
|
||||
if (first) {
|
||||
oid = value < 80 ? Math.floor(value / 40) + "." + value % 40 : "2." + (value - 80);
|
||||
first = false;
|
||||
} else {
|
||||
oid += "." + value;
|
||||
}
|
||||
oid += "." + (value + b);
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
@@ -159905,12 +159873,12 @@ var require_pem = __commonJS({
|
||||
};
|
||||
pem.decode = function(str) {
|
||||
var rval = [];
|
||||
var messages = _pemMessageScanner(str);
|
||||
var rHeader = /(?:^|[^\x21-\x7e])([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/;
|
||||
var rMessage = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g;
|
||||
var rHeader = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/;
|
||||
var rCRLF = /\r?\n/;
|
||||
var match2;
|
||||
while (true) {
|
||||
match2 = messages.next();
|
||||
match2 = rMessage.exec(str);
|
||||
if (!match2) {
|
||||
break;
|
||||
}
|
||||
@@ -159933,7 +159901,7 @@ var require_pem = __commonJS({
|
||||
var lines = match2[2].split(rCRLF);
|
||||
var li = 0;
|
||||
while (match2 && li < lines.length) {
|
||||
var line = rtrim(lines[li]);
|
||||
var line = lines[li].replace(/\s+$/, "");
|
||||
for (var nl = li + 1; nl < lines.length; ++nl) {
|
||||
var next = lines[nl];
|
||||
if (!/\s/.test(next[0])) {
|
||||
@@ -160011,140 +159979,6 @@ var require_pem = __commonJS({
|
||||
function ltrim(str) {
|
||||
return str.replace(/^\s+/, "");
|
||||
}
|
||||
function rtrim(str) {
|
||||
var end = str.length;
|
||||
while (end > 0 && /\s/.test(str.charAt(end - 1))) {
|
||||
--end;
|
||||
}
|
||||
return str.substring(0, end);
|
||||
}
|
||||
function _pemMessageScanner(str) {
|
||||
var rBody = /[:A-Za-z0-9+\/=\s]/;
|
||||
var rNotBody = /[^:A-Za-z0-9+\/=\s]/g;
|
||||
var rNotHeader = /[^\x21-\x7e\s]/g;
|
||||
var rLabel = /[A-Z0-9- ]/;
|
||||
function indexOfRegex(regex, i) {
|
||||
regex.lastIndex = i;
|
||||
var match2 = regex.exec(str);
|
||||
return match2 ? match2.index : str.length;
|
||||
}
|
||||
function labelAt(i) {
|
||||
for (var j = i; j < str.length && rLabel.test(str.charAt(j)); ++j) {
|
||||
if (j > i && str.substr(j, 5) === "-----") {
|
||||
return str.substring(i, j);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function blankLineEnd(i) {
|
||||
if (str.charAt(i) === "\r") {
|
||||
++i;
|
||||
}
|
||||
if (str.charAt(i) !== "\n") {
|
||||
return -1;
|
||||
}
|
||||
if (str.charAt(++i) === "\r") {
|
||||
++i;
|
||||
}
|
||||
return str.charAt(i) === "\n" ? i + 1 : -1;
|
||||
}
|
||||
function firstBlankLine(start2, end2) {
|
||||
for (var i = start2; i < end2; ++i) {
|
||||
var v = blankLineEnd(i);
|
||||
if (v !== -1 && v < end2) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
var ends = {};
|
||||
for (var end = str.indexOf("-----END "); end !== -1; end = str.indexOf("-----END ", end + 1)) {
|
||||
var endLabel = labelAt(end + 9);
|
||||
var start = end;
|
||||
while (start > 0 && rBody.test(str.charAt(start - 1))) {
|
||||
--start;
|
||||
}
|
||||
var blank = firstBlankLine(start, end);
|
||||
if (endLabel !== null && blank !== -1) {
|
||||
var key = "$" + endLabel;
|
||||
(ends[key] = ends[key] || []).push({ end, blank });
|
||||
}
|
||||
}
|
||||
var pos = 0;
|
||||
var headerEnd = -1;
|
||||
return {
|
||||
next: function() {
|
||||
var begin;
|
||||
while ((begin = str.indexOf("-----BEGIN ", pos)) !== -1) {
|
||||
pos = begin + 1;
|
||||
var label = labelAt(begin + 11);
|
||||
if (label === null) {
|
||||
continue;
|
||||
}
|
||||
var q = begin + 16 + label.length;
|
||||
var bodyEnd = indexOfRegex(rNotBody, q);
|
||||
var bodyEndOk = str.substr(bodyEnd, 9) === "-----END " && labelAt(bodyEnd + 9) === label;
|
||||
if (q > headerEnd) {
|
||||
headerEnd = indexOfRegex(rNotHeader, q);
|
||||
}
|
||||
var later = null;
|
||||
var list = ends["$" + label];
|
||||
if (list) {
|
||||
var lo = 0;
|
||||
var hi = list.length;
|
||||
while (lo < hi) {
|
||||
var mid = lo + hi >> 1;
|
||||
if (list[mid].end > bodyEnd) {
|
||||
hi = mid;
|
||||
} else {
|
||||
lo = mid + 1;
|
||||
}
|
||||
}
|
||||
later = list[lo] || null;
|
||||
}
|
||||
var starts = [];
|
||||
if (str.charAt(q) === "\r") {
|
||||
if (str.charAt(q + 1) === "\n") {
|
||||
starts.push(q + 2);
|
||||
}
|
||||
starts.push(q + 1);
|
||||
} else if (str.charAt(q) === "\n") {
|
||||
starts.push(q + 1);
|
||||
}
|
||||
starts.push(q);
|
||||
for (var i = 0; i < starts.length; ++i) {
|
||||
var t = starts[i];
|
||||
var blank2 = bodyEndOk ? firstBlankLine(t + 1, bodyEnd) : -1;
|
||||
var end2 = bodyEnd;
|
||||
if (blank2 === -1 && later) {
|
||||
blank2 = later.blank;
|
||||
end2 = later.end;
|
||||
}
|
||||
if (blank2 !== -1 && blank2 <= headerEnd) {
|
||||
var v = blankLineEnd(blank2);
|
||||
pos = end2 + 14 + label.length;
|
||||
return [
|
||||
str.substring(begin, pos),
|
||||
label,
|
||||
str.substring(t, v),
|
||||
str.substring(v, end2)
|
||||
];
|
||||
}
|
||||
if (bodyEndOk && t < bodyEnd) {
|
||||
pos = bodyEnd + 14 + label.length;
|
||||
return [
|
||||
str.substring(begin, pos),
|
||||
label,
|
||||
void 0,
|
||||
str.substring(t, bodyEnd)
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -162582,7 +162416,7 @@ var require_jsbn = __commonJS({
|
||||
return r;
|
||||
}
|
||||
function bnModInverse(m) {
|
||||
if (this.signum() <= 0 || m.signum() <= 0) {
|
||||
if (this.signum() == 0) {
|
||||
return BigInteger.ZERO;
|
||||
}
|
||||
var ac = m.isEven();
|
||||
@@ -163461,41 +163295,6 @@ var require_rsa = __commonJS({
|
||||
capture: "digest"
|
||||
}]
|
||||
};
|
||||
var _encodeDigestInfo = function(oid, digest, withParameters) {
|
||||
var digestAlgorithm = [asn1.create(
|
||||
asn1.Class.UNIVERSAL,
|
||||
asn1.Type.OID,
|
||||
false,
|
||||
asn1.oidToDer(oid).getBytes()
|
||||
)];
|
||||
if (withParameters) {
|
||||
digestAlgorithm.push(asn1.create(
|
||||
asn1.Class.UNIVERSAL,
|
||||
asn1.Type.NULL,
|
||||
false,
|
||||
""
|
||||
));
|
||||
}
|
||||
return asn1.toDer(asn1.create(
|
||||
asn1.Class.UNIVERSAL,
|
||||
asn1.Type.SEQUENCE,
|
||||
true,
|
||||
[
|
||||
asn1.create(
|
||||
asn1.Class.UNIVERSAL,
|
||||
asn1.Type.SEQUENCE,
|
||||
true,
|
||||
digestAlgorithm
|
||||
),
|
||||
asn1.create(
|
||||
asn1.Class.UNIVERSAL,
|
||||
asn1.Type.OCTETSTRING,
|
||||
false,
|
||||
digest
|
||||
)
|
||||
]
|
||||
)).getBytes();
|
||||
};
|
||||
var emsaPkcs1v15encode = function(md2) {
|
||||
var oid;
|
||||
if (md2.algorithm in pki2.oids) {
|
||||
@@ -163999,13 +163798,6 @@ var require_rsa = __commonJS({
|
||||
);
|
||||
}
|
||||
}
|
||||
var withParameters = _encodeDigestInfo(oid, capture.digest, true);
|
||||
var withoutParameters = _encodeDigestInfo(oid, capture.digest, false);
|
||||
if (d2.substring(0, withParameters.length) !== withParameters && d2.substring(0, withoutParameters.length) !== withoutParameters) {
|
||||
throw new Error(
|
||||
"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value."
|
||||
);
|
||||
}
|
||||
return digest2 === capture.digest;
|
||||
}
|
||||
};
|
||||
@@ -164966,9 +164758,6 @@ var require_pbe = __commonJS({
|
||||
};
|
||||
pki2.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md2) {
|
||||
var j, l;
|
||||
if (!(iter >= 1)) {
|
||||
throw new Error("PKCS#12 key derivation iteration count must be >= 1.");
|
||||
}
|
||||
if (typeof md2 === "undefined" || md2 === null) {
|
||||
if (!("sha1" in forge.md)) {
|
||||
throw new Error('"sha1" hash algorithm unavailable.');
|
||||
@@ -166254,7 +166043,6 @@ var require_x509 = __commonJS({
|
||||
};
|
||||
var _verifySignature = function(options) {
|
||||
var cert = options.certificate;
|
||||
var publicKey = options.publicKey || cert.publicKey;
|
||||
var scheme;
|
||||
switch (cert.signatureOid) {
|
||||
case oids.sha1WithRSAEncryption:
|
||||
@@ -166292,7 +166080,7 @@ var require_x509 = __commonJS({
|
||||
);
|
||||
break;
|
||||
}
|
||||
return publicKey.verify(
|
||||
return cert.publicKey.verify(
|
||||
options.md.digest().getBytes(),
|
||||
options.signature,
|
||||
scheme
|
||||
@@ -166512,8 +166300,7 @@ var require_x509 = __commonJS({
|
||||
}
|
||||
if (md2 !== null) {
|
||||
rval = _verifySignature({
|
||||
certificate: child,
|
||||
publicKey: cert.publicKey,
|
||||
certificate: cert,
|
||||
md: md2,
|
||||
signature: child.signature
|
||||
});
|
||||
@@ -167748,7 +167535,10 @@ var require_x509 = __commonJS({
|
||||
}
|
||||
}
|
||||
if (parent) {
|
||||
var parents = forge.util.isArray(parent) ? parent.slice() : [parent];
|
||||
var parents = parent;
|
||||
if (!forge.util.isArray(parents)) {
|
||||
parents = [parents];
|
||||
}
|
||||
var verified = false;
|
||||
while (!verified && parents.length > 0) {
|
||||
parent = parents.shift();
|
||||
@@ -167793,7 +167583,7 @@ var require_x509 = __commonJS({
|
||||
}
|
||||
}
|
||||
if (error3 === null && (!first || chain.length === 0 && (!parent || selfSigned))) {
|
||||
var bcExt = cert.getExtension({ id: "2.5.29.19" });
|
||||
var bcExt = cert.getExtension("basicConstraints");
|
||||
var keyUsageExt = cert.getExtension("keyUsage");
|
||||
if (keyUsageExt !== null) {
|
||||
if (!keyUsageExt.keyCertSign || bcExt === null) {
|
||||
@@ -167815,7 +167605,7 @@ var require_x509 = __commonJS({
|
||||
error: pki2.certificateError.bad_certificate
|
||||
};
|
||||
}
|
||||
if (error3 === null && bcExt !== null && "pathLenConstraint" in bcExt) {
|
||||
if (error3 === null && keyUsageExt !== null && "pathLenConstraint" in bcExt) {
|
||||
var pathLen = depth - 1;
|
||||
if (pathLen > bcExt.pathLenConstraint) {
|
||||
error3 = {
|
||||
@@ -168199,9 +167989,6 @@ var require_pkcs12 = __commonJS({
|
||||
}
|
||||
var macSalt = new forge.util.ByteBuffer(capture.macSalt);
|
||||
var macIterations = "macIterations" in capture ? parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1;
|
||||
if (!(macIterations >= 1)) {
|
||||
throw new Error("PKCS#12 MAC iteration count must be >= 1.");
|
||||
}
|
||||
var macKey = p12.generateKey(
|
||||
password,
|
||||
macSalt,
|
||||
@@ -169463,7 +169250,7 @@ var require_tls = __commonJS({
|
||||
}
|
||||
});
|
||||
}
|
||||
if (c.session.serverCertificate === null) {
|
||||
if (c.serverCertificate === null) {
|
||||
var error3 = {
|
||||
message: "No server certificate provided. Not enough security.",
|
||||
send: true,
|
||||
@@ -169487,8 +169274,8 @@ var require_tls = __commonJS({
|
||||
error3.alert.description = ret;
|
||||
}
|
||||
}
|
||||
return c.error(c, error3);
|
||||
}
|
||||
return c.error(c, error3);
|
||||
}
|
||||
if (c.session.certificateRequest !== null) {
|
||||
record = tls.createRecord(c, {
|
||||
@@ -169744,7 +169531,7 @@ var require_tls = __commonJS({
|
||||
var length = b.getInt16();
|
||||
var payload = b.getBytes(length);
|
||||
if (type === tls.HeartbeatMessageType.heartbeat_request) {
|
||||
if (c.handshakes === 0 || c.handshaking || length > payload.length) {
|
||||
if (c.handshaking || length > payload.length) {
|
||||
return c.process();
|
||||
}
|
||||
tls.queue(c, tls.createRecord(c, {
|
||||
@@ -170659,7 +170446,6 @@ var require_tls = __commonJS({
|
||||
description: tls.Alert.Description.unexpected_message
|
||||
}
|
||||
});
|
||||
return rval;
|
||||
}
|
||||
}
|
||||
c2.record.ready = true;
|
||||
@@ -170724,48 +170510,24 @@ var require_tls = __commonJS({
|
||||
tls.flush(c);
|
||||
}
|
||||
};
|
||||
var _processing = false;
|
||||
var _processNext = false;
|
||||
var _processRecord = function(c2) {
|
||||
var rval = 0;
|
||||
if (!c2.fail) {
|
||||
if (c2.record !== null && c2.record.ready && c2.record.fragment.isEmpty()) {
|
||||
c2.record = null;
|
||||
}
|
||||
if (c2.record === null) {
|
||||
rval = _readRecordHeader(c2);
|
||||
}
|
||||
if (!c2.fail && c2.record !== null && !c2.record.ready) {
|
||||
rval = _readRecord(c2);
|
||||
}
|
||||
if (!c2.fail && c2.record !== null && c2.record.ready) {
|
||||
_update(c2, c2.record);
|
||||
}
|
||||
}
|
||||
return rval;
|
||||
};
|
||||
c.process = function(data) {
|
||||
var rval = 0;
|
||||
if (data) {
|
||||
c.input.putBytes(data);
|
||||
}
|
||||
if (_processing && typeof data === "undefined") {
|
||||
_processNext = true;
|
||||
return rval;
|
||||
}
|
||||
var processing = _processing;
|
||||
var processNext = _processNext;
|
||||
_processing = true;
|
||||
_processNext = false;
|
||||
try {
|
||||
rval = _processRecord(c);
|
||||
while (_processNext) {
|
||||
_processNext = false;
|
||||
_processRecord(c);
|
||||
if (!c.fail) {
|
||||
if (c.record !== null && c.record.ready && c.record.fragment.isEmpty()) {
|
||||
c.record = null;
|
||||
}
|
||||
if (c.record === null) {
|
||||
rval = _readRecordHeader(c);
|
||||
}
|
||||
if (!c.fail && c.record !== null && !c.record.ready) {
|
||||
rval = _readRecord(c);
|
||||
}
|
||||
if (!c.fail && c.record !== null && c.record.ready) {
|
||||
_update(c, c.record);
|
||||
}
|
||||
} finally {
|
||||
_processing = processing;
|
||||
_processNext = processNext;
|
||||
}
|
||||
return rval;
|
||||
};
|
||||
@@ -178231,7 +177993,7 @@ function getDiffRangesJsonFilePath(env = getEnv()) {
|
||||
return path2.join(getTemporaryDirectory(env), PR_DIFF_RANGE_JSON_FILENAME);
|
||||
}
|
||||
function getActionVersion() {
|
||||
return "4.39.3";
|
||||
return "3.39.2";
|
||||
}
|
||||
function getWorkflowEventName(env = getEnv()) {
|
||||
return env.getRequired("GITHUB_EVENT_NAME" /* GITHUB_EVENT_NAME */);
|
||||
@@ -188776,19 +188538,11 @@ function filterAlertsByDiffRange(logger2, sarifLog) {
|
||||
return locations.some((physicalLocation) => {
|
||||
const locationUri = physicalLocation?.artifactLocation?.uri;
|
||||
const locationStartLine = physicalLocation?.region?.startLine;
|
||||
if (typeof locationUri !== "string" || !locationUri || locationStartLine === void 0) {
|
||||
if (!locationUri || locationStartLine === void 0) {
|
||||
return false;
|
||||
}
|
||||
let decodedLocationUri = locationUri;
|
||||
try {
|
||||
decodedLocationUri = decodeURIComponent(locationUri);
|
||||
} catch {
|
||||
logger2.debug(
|
||||
`Failed to decode location URI "${locationUri}", comparing it as a raw path`
|
||||
);
|
||||
}
|
||||
return diffRanges.some(
|
||||
(range2) => (range2.path === decodedLocationUri || range2.path === locationUri) && (range2.startLine <= locationStartLine && range2.endLine >= locationStartLine || range2.startLine === 0 && range2.endLine === 0)
|
||||
(range2) => range2.path === locationUri && (range2.startLine <= locationStartLine && range2.endLine >= locationStartLine || range2.startLine === 0 && range2.endLine === 0)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "4.39.3",
|
||||
"version": "4.39.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "codeql",
|
||||
"version": "4.39.3",
|
||||
"version": "4.39.2",
|
||||
"license": "MIT",
|
||||
"workspaces": [
|
||||
"pr-checks"
|
||||
@@ -33,7 +33,7 @@
|
||||
"js-yaml": "^5.5.0",
|
||||
"jsonschema": "1.5.0",
|
||||
"long": "^5.3.2",
|
||||
"node-forge": "^1.4.1",
|
||||
"node-forge": "^1.4.0",
|
||||
"semver": "^7.8.5",
|
||||
"undici": "^7.30.1",
|
||||
"uuid": "^14.0.3"
|
||||
@@ -8198,9 +8198,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-forge": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.1.tgz",
|
||||
"integrity": "sha512-w5/MfWaeMrpR/5ba6fZyAUTLSuE6aYz7H/3cYrqwZEmf5eQS3IaaLgJt4MBv7HglGFWmV22K8h4U18RJQmw/ow==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
||||
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
||||
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||
"engines": {
|
||||
"node": ">= 6.13.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "codeql",
|
||||
"version": "4.39.3",
|
||||
"version": "3.39.2",
|
||||
"private": true,
|
||||
"description": "CodeQL action",
|
||||
"scripts": {
|
||||
@@ -42,7 +42,7 @@
|
||||
"js-yaml": "^5.5.0",
|
||||
"jsonschema": "1.5.0",
|
||||
"long": "^5.3.2",
|
||||
"node-forge": "^1.4.1",
|
||||
"node-forge": "^1.4.0",
|
||||
"semver": "^7.8.5",
|
||||
"undici": "^7.30.1",
|
||||
"uuid": "^14.0.3"
|
||||
|
||||
@@ -10,13 +10,17 @@ import { afterEach, beforeEach, describe, it } from "node:test";
|
||||
|
||||
import {
|
||||
CLI_VERSION_ENV_VAR,
|
||||
getChangenote,
|
||||
getCLIVersion,
|
||||
getPRNumber,
|
||||
getPRUrl,
|
||||
PR_URL_ENV_VAR,
|
||||
updateChangelog,
|
||||
} from "./bundle-changelog";
|
||||
import { isValidChangenoteContent } from "./changelog/validate";
|
||||
import {
|
||||
EMPTY_CHANGELOG,
|
||||
NO_CHANGES_STR,
|
||||
UNRELEASED_PLACEHOLDER,
|
||||
} from "./changelog";
|
||||
|
||||
let testDir: string;
|
||||
|
||||
@@ -81,15 +85,58 @@ describe("getPRNumber", async () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("getChangenote", async () => {
|
||||
await it("returns a note linking to the bundle release and the PR", async () => {
|
||||
assert.equal(
|
||||
getChangenote("1.2.3", testPrUrl),
|
||||
"- 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",
|
||||
);
|
||||
const testChangelog = `${EMPTY_CHANGELOG.trimEnd()}
|
||||
|
||||
## 4.23.7
|
||||
|
||||
- Other change
|
||||
|
||||
## 4.23.6
|
||||
|
||||
${NO_CHANGES_STR}`;
|
||||
|
||||
const expectedChangelog = `# CodeQL Action Changelog
|
||||
|
||||
## ${UNRELEASED_PLACEHOLDER}
|
||||
|
||||
- Update default CodeQL bundle version to
|
||||
|
||||
## 4.23.7
|
||||
|
||||
- Other change
|
||||
|
||||
## 4.23.6
|
||||
|
||||
${NO_CHANGES_STR}`;
|
||||
|
||||
describe("updateChangelog", async () => {
|
||||
await it("removes `NO_CHANGES_STR` if present in [UNRELEASED] section", async () => {
|
||||
const result = updateChangelog(EMPTY_CHANGELOG, "");
|
||||
assert.ok(!result.includes(NO_CHANGES_STR));
|
||||
});
|
||||
|
||||
await it("returns valid changenote content", async () => {
|
||||
assert.ok(isValidChangenoteContent(getChangenote("1.2.3", testPrUrl)));
|
||||
await it("doesn't remove `NO_CHANGES_STR` if present in versioned section", async () => {
|
||||
const result = updateChangelog(
|
||||
EMPTY_CHANGELOG.replace(UNRELEASED_PLACEHOLDER, "1.2.3"),
|
||||
"",
|
||||
);
|
||||
assert.ok(result.includes(NO_CHANGES_STR));
|
||||
});
|
||||
|
||||
await it("throws if there are no sections", async () => {
|
||||
assert.throws(() => {
|
||||
updateChangelog(
|
||||
"# CodeQL Action Changelog",
|
||||
"- Update default CodeQL bundle version to",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
await it("adds note at the end of the first section", async () => {
|
||||
const result = updateChangelog(
|
||||
testChangelog,
|
||||
"- Update default CodeQL bundle version to",
|
||||
);
|
||||
assert.deepEqual(result, expectedChangelog);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
#!/usr/bin/env npx tsx
|
||||
|
||||
/**
|
||||
* Creates a changenote file for an update to the default CodeQL CLI bundle.
|
||||
* Updates the changelog with a change note for an updated CodeQL CLI bundle.
|
||||
*/
|
||||
|
||||
import * as fs from "node:fs";
|
||||
import * as path from "node:path";
|
||||
|
||||
import { CHANGENOTES_DIR, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
|
||||
import {
|
||||
parseChangelog,
|
||||
renderChangelog,
|
||||
UNRELEASED_PLACEHOLDER,
|
||||
} from "./changelog";
|
||||
import { CHANGELOG_FILE, CLI_BUNDLE_RELEASE_URL_PREFIX } from "./config";
|
||||
import { getErrorMessage } from "./util";
|
||||
|
||||
export const CLI_VERSION_ENV_VAR = "CLI_VERSION";
|
||||
@@ -54,19 +58,42 @@ export function getPRNumber(prUrl: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the contents of the changenote file for an update to the default
|
||||
* CodeQL CLI bundle.
|
||||
* Updates `changelog` by adding `changelogNote` to the first section.
|
||||
*
|
||||
* @param cliVersion The CodeQL CLI version of the new default bundle.
|
||||
* @param prUrl The URL of the PR that updates the default bundle.
|
||||
* @throws If the PR number can't be determined from `prUrl`.
|
||||
* @param contents The existing changelog contents.
|
||||
* @param changelogNote The note to add to the first section.
|
||||
*/
|
||||
export function getChangenote(cliVersion: string, prUrl: string): string {
|
||||
// The GitHub Release for the new bundle version.
|
||||
const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
|
||||
export function updateChangelog(contents: string, changelogNote: string) {
|
||||
// If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
|
||||
contents = contents.replace(
|
||||
`## ${UNRELEASED_PLACEHOLDER}\n\nNo user facing changes.`,
|
||||
`## ${UNRELEASED_PLACEHOLDER}\n`,
|
||||
);
|
||||
|
||||
const prNumber = getPRNumber(prUrl);
|
||||
return `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})\n`;
|
||||
const changelog = parseChangelog(contents);
|
||||
|
||||
if (changelog.sections.length === 0) {
|
||||
throw new Error("The changelog contains no existing sections.");
|
||||
}
|
||||
|
||||
// Add the changelog note to the bottom of the first section.
|
||||
const firstSection = changelog.sections[0];
|
||||
const lastLine = firstSection.bodyLines.pop();
|
||||
|
||||
if (lastLine !== undefined && lastLine.trim() !== "") {
|
||||
// We expect the last line to be empty. If it isn't for some reason,
|
||||
// add it back.
|
||||
firstSection.bodyLines.push(lastLine);
|
||||
}
|
||||
|
||||
firstSection.bodyLines.push(changelogNote);
|
||||
|
||||
// If the last line is empty as expected, then add it back in after the new note.
|
||||
if (lastLine?.trim() === "") {
|
||||
firstSection.bodyLines.push(lastLine);
|
||||
}
|
||||
|
||||
return renderChangelog(changelog);
|
||||
}
|
||||
|
||||
function main() {
|
||||
@@ -74,19 +101,22 @@ function main() {
|
||||
const cliVersion = getCLIVersion();
|
||||
const prUrl = getPRUrl();
|
||||
|
||||
// Include the CLI version in the file name so that changenotes for
|
||||
// different bundle updates don't conflict.
|
||||
const changenotePath = path.join(
|
||||
CHANGENOTES_DIR,
|
||||
`update-bundle-${cliVersion}.md`,
|
||||
);
|
||||
fs.writeFileSync(changenotePath, getChangenote(cliVersion, prUrl));
|
||||
// The GitHub Release for the new bundle version.
|
||||
const bundleReleaseUrl = `${CLI_BUNDLE_RELEASE_URL_PREFIX}${cliVersion}`;
|
||||
|
||||
// Get the PR number from the PR URL.
|
||||
const prNumber = getPRNumber(prUrl);
|
||||
const changelogNote = `- Update default CodeQL bundle version to [${cliVersion}](${bundleReleaseUrl}). [#${prNumber}](${prUrl})`;
|
||||
|
||||
let changelog = fs.readFileSync(CHANGELOG_FILE, "utf-8");
|
||||
|
||||
changelog = updateChangelog(changelog, changelogNote);
|
||||
|
||||
fs.writeFileSync(CHANGELOG_FILE, changelog);
|
||||
|
||||
return 0;
|
||||
} catch (err) {
|
||||
console.error(
|
||||
`Failed to create changenote for bundle update: ${getErrorMessage(err)}`,
|
||||
);
|
||||
console.error(`Failed to bundle changelog: ${getErrorMessage(err)}`);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ validationJobs:
|
||||
installNode: true
|
||||
steps:
|
||||
- name: Download workflow artifact
|
||||
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: test-mode-sarif-*
|
||||
path: sarif
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"@octokit/core": "^7.0.8",
|
||||
"@octokit/plugin-paginate-rest": ">=16.0.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
|
||||
"glob": "^14.0.3",
|
||||
"glob": "^13.0.6",
|
||||
"lite-matter": "^0.1.2",
|
||||
"mdast-util-from-markdown": "^2.1.0",
|
||||
"semver": "^7.8.5",
|
||||
|
||||
@@ -56,18 +56,9 @@ jobs:
|
||||
|
||||
const result = scanGeneratedWorkflows(workflowDir);
|
||||
|
||||
assert.deepEqual(
|
||||
result.actionVersions["actions/checkout"],
|
||||
new Set(["v4"]),
|
||||
);
|
||||
assert.deepEqual(
|
||||
result.actionVersions["actions/setup-node"],
|
||||
new Set(["v5"]),
|
||||
);
|
||||
assert.deepEqual(
|
||||
result.actionVersions["actions/setup-go"],
|
||||
new Set(["v6"]),
|
||||
);
|
||||
assert.equal(result["actions/checkout"], "v4");
|
||||
assert.equal(result["actions/setup-node"], "v5");
|
||||
assert.equal(result["actions/setup-go"], "v6");
|
||||
});
|
||||
|
||||
await it("scanning workflows with version comments", () => {
|
||||
@@ -87,18 +78,12 @@ jobs:
|
||||
|
||||
const result = scanGeneratedWorkflows(workflowDir);
|
||||
|
||||
assert.deepEqual(
|
||||
result.actionVersions["actions/checkout"],
|
||||
new Set(["v4"]),
|
||||
);
|
||||
assert.deepEqual(
|
||||
result.actionVersions["ruby/setup-ruby"],
|
||||
new Set(["44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0"]),
|
||||
);
|
||||
assert.deepEqual(
|
||||
result.actionVersions["actions/setup-python"],
|
||||
new Set(["v6 # Latest Python"]),
|
||||
assert.equal(result["actions/checkout"], "v4");
|
||||
assert.equal(
|
||||
result["ruby/setup-ruby"],
|
||||
"44511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
|
||||
);
|
||||
assert.equal(result["actions/setup-python"], "v6 # Latest Python");
|
||||
});
|
||||
|
||||
await it("ignores local actions", () => {
|
||||
@@ -118,15 +103,9 @@ jobs:
|
||||
|
||||
const result = scanGeneratedWorkflows(workflowDir);
|
||||
|
||||
assert.deepEqual(
|
||||
result.actionVersions["actions/checkout"],
|
||||
new Set(["v4"]),
|
||||
);
|
||||
assert.equal(
|
||||
"./.github/actions/local-action" in result.actionVersions,
|
||||
false,
|
||||
);
|
||||
assert.equal("./another-local-action" in result.actionVersions, false);
|
||||
assert.equal(result["actions/checkout"], "v4");
|
||||
assert.equal("./.github/actions/local-action" in result, false);
|
||||
assert.equal("./another-local-action" in result, false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -149,8 +128,8 @@ const steps = [
|
||||
fs.writeFileSync(syncTsPath, syncTsContent);
|
||||
|
||||
const actionVersions = {
|
||||
"actions/setup-node": new Set(["v5"]),
|
||||
"actions/setup-go": new Set(["v6"]),
|
||||
"actions/setup-node": "v5",
|
||||
"actions/setup-go": "v6",
|
||||
};
|
||||
|
||||
const result = updateSyncTs(syncTsPath, actionVersions);
|
||||
@@ -176,7 +155,7 @@ const steps = [
|
||||
fs.writeFileSync(syncTsPath, syncTsContent);
|
||||
|
||||
const actionVersions = {
|
||||
"actions/setup-node": new Set(["v5 # Latest version"]),
|
||||
"actions/setup-node": "v5 # Latest version",
|
||||
};
|
||||
|
||||
const result = updateSyncTs(syncTsPath, actionVersions);
|
||||
@@ -203,7 +182,7 @@ const steps = [
|
||||
fs.writeFileSync(syncTsPath, syncTsContent);
|
||||
|
||||
const actionVersions = {
|
||||
"actions/setup-node": new Set(["v5"]),
|
||||
"actions/setup-node": "v5",
|
||||
};
|
||||
|
||||
const result = updateSyncTs(syncTsPath, actionVersions);
|
||||
@@ -227,9 +206,7 @@ const steps = [
|
||||
fs.writeFileSync(syncTsPath, syncTsContent);
|
||||
|
||||
const actionVersions = {
|
||||
"actions/setup-node": new Set([
|
||||
"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0",
|
||||
]),
|
||||
"actions/setup-node": "48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0",
|
||||
};
|
||||
|
||||
const result = updateSyncTs(syncTsPath, actionVersions);
|
||||
@@ -267,9 +244,8 @@ steps:
|
||||
"actions/checkout": "v4",
|
||||
"actions/setup-node": "v5 # Latest",
|
||||
};
|
||||
const byWorkflow = { ["test.yml"]: actionVersions };
|
||||
|
||||
const result = updateTemplateFiles(checksDir, byWorkflow);
|
||||
const result = updateTemplateFiles(checksDir, actionVersions);
|
||||
assert.equal(result.length, 1);
|
||||
assert.ok(result.includes(templatePath));
|
||||
|
||||
@@ -293,9 +269,8 @@ steps:
|
||||
const actionVersions = {
|
||||
"ruby/setup-ruby": "55511735964dcb71245e7e55f72539531f7bc0eb # v1.257.0",
|
||||
};
|
||||
const byWorkflow = { ["test.yml"]: actionVersions };
|
||||
|
||||
const result = updateTemplateFiles(checksDir, byWorkflow);
|
||||
const result = updateTemplateFiles(checksDir, actionVersions);
|
||||
assert.equal(result.length, 1);
|
||||
|
||||
const updatedContent = fs.readFileSync(templatePath, "utf8");
|
||||
|
||||
@@ -27,39 +27,16 @@ const CHECKS_DIR = path.join(PR_CHECKS_DIR, "checks");
|
||||
const WORKFLOW_DIR = path.join(REPO_ROOT, ".github", "workflows");
|
||||
const SYNC_TS_PATH = path.join(PR_CHECKS_DIR, "sync.ts");
|
||||
|
||||
/** Type alias for action names. */
|
||||
type ActionName = string;
|
||||
|
||||
/** Type alias for action versions. May include a comment. */
|
||||
type ActionVersion = string;
|
||||
|
||||
/** Mappings of {@link ActionName}s to {@link ActionVersion}s. */
|
||||
type ActionVersions = Record<ActionName, ActionVersion>;
|
||||
|
||||
/** Mappings of workflow names to {@link ActionVersions}. */
|
||||
type ActionVersionsByWorkflow = Record<string, ActionVersions>;
|
||||
|
||||
/** The result of {@link scanGeneratedWorkflows}. */
|
||||
type ScanWorkflowResult = {
|
||||
/** A mapping of {@link ActionName}s to all encountered {@link ActionVersion}s. */
|
||||
actionVersions: Record<ActionName, Set<ActionVersion>>;
|
||||
|
||||
/** A mapping of workflow names to {@link ActionVersions}. */
|
||||
actionVersionsByWorkflow: ActionVersionsByWorkflow;
|
||||
};
|
||||
|
||||
/**
|
||||
* Scan generated workflow files to extract the latest action versions.
|
||||
*
|
||||
* @param workflowDir - Path to .github/workflows directory
|
||||
*
|
||||
* @returns A {@link ScanWorkflowResult} object containing information about the extracted action versions.
|
||||
* @returns Map from action names to their latest versions (including comments)
|
||||
*/
|
||||
export function scanGeneratedWorkflows(
|
||||
workflowDir: string,
|
||||
): ScanWorkflowResult {
|
||||
const actionVersionsByWorkflow: ActionVersionsByWorkflow = {};
|
||||
const actionVersions: Record<ActionName, Set<ActionVersion>> = {};
|
||||
): Record<string, string> {
|
||||
const actionVersions: Record<string, string> = {};
|
||||
|
||||
const generatedFiles = fs
|
||||
.readdirSync(workflowDir)
|
||||
@@ -69,10 +46,6 @@ export function scanGeneratedWorkflows(
|
||||
for (const filePath of generatedFiles) {
|
||||
const content = fs.readFileSync(filePath, "utf8");
|
||||
|
||||
// Get the basename of the workflow and drop the leading `__` from it.
|
||||
const workflowName = path.basename(filePath).slice(2);
|
||||
actionVersionsByWorkflow[workflowName] = {};
|
||||
|
||||
// Find all action uses in the file, including potential comments
|
||||
// This pattern captures: action_name@version_with_possible_comment
|
||||
const pattern = /uses:\s+([^/\s]+\/[^@\s]+)@([^@\n]+)/g;
|
||||
@@ -84,26 +57,13 @@ export function scanGeneratedWorkflows(
|
||||
|
||||
// Only track non-local actions (those with / but not starting with ./)
|
||||
if (!actionName.startsWith("./")) {
|
||||
// Record the version of the action for this workflow.
|
||||
actionVersionsByWorkflow[workflowName][actionName] = versionWithComment;
|
||||
|
||||
// Record this version for the action so that we can write it to `sync.ts` if needed.
|
||||
// Usually we'd expect there to be exactly one version per action across all workflows,
|
||||
// but sometimes these can go out-of-sync if e.g. a workflow is added in a branch and a
|
||||
// Dependabot PR is merged in the meantime that changes the version of an action that is
|
||||
// used in the new workflow. Different versions of the same action across different
|
||||
// workflows is not fundamentally a problem, but we may need to pick one for `sync.ts`
|
||||
// so we warn there if we have multiple versions of an action.
|
||||
if (actionVersions[actionName] === undefined) {
|
||||
actionVersions[actionName] = new Set([versionWithComment]);
|
||||
} else if (!actionVersions[actionName].has(versionWithComment)) {
|
||||
actionVersions[actionName].add(versionWithComment);
|
||||
}
|
||||
// Assume that version numbers are consistent (this should be the case on a Dependabot update PR)
|
||||
actionVersions[actionName] = versionWithComment;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { actionVersions, actionVersionsByWorkflow };
|
||||
return actionVersions;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +79,7 @@ export function scanGeneratedWorkflows(
|
||||
*/
|
||||
export function updateSyncTs(
|
||||
syncTsPath: string,
|
||||
actionVersions: Record<ActionName, Set<ActionVersion>>,
|
||||
actionVersions: Record<string, string>,
|
||||
): boolean {
|
||||
if (!fs.existsSync(syncTsPath)) {
|
||||
throw new Error(`Could not find ${syncTsPath}`);
|
||||
@@ -129,18 +89,9 @@ export function updateSyncTs(
|
||||
const originalContent = content;
|
||||
|
||||
// Update hardcoded action versions
|
||||
for (const [actionName, versionsWithComments] of Object.entries(
|
||||
for (const [actionName, versionWithComment] of Object.entries(
|
||||
actionVersions,
|
||||
)) {
|
||||
// We usually expect `versionsWithComments` to contain one version. If there are multiple,
|
||||
// we arbitrarily pick one and warn about it.
|
||||
const versionsWithCommentsArray = Array.from(versionsWithComments);
|
||||
const versionWithComment = versionsWithCommentsArray[0];
|
||||
if (versionsWithComments.size > 1) {
|
||||
console.warn(
|
||||
`Inconsistent versions for ${actionName}. Arbitrarily picking '${versionWithComment}'. All found: ${versionsWithCommentsArray.join(", ")}`,
|
||||
);
|
||||
}
|
||||
// Split the scanned value into the ref (e.g. a commit SHA) and the optional
|
||||
// trailing version comment (e.g. `v6.0.3`).
|
||||
const ref = versionWithComment.includes("#")
|
||||
@@ -187,12 +138,12 @@ export function updateSyncTs(
|
||||
* Update action versions in template files in pr-checks/checks/
|
||||
*
|
||||
* @param checksDir - Path to pr-checks/checks directory
|
||||
* @param actionVersionsByWorkflow - Map of workflows to maps of action names to versions (may include comments)
|
||||
* @param actionVersions - Map of action names to versions (may include comments)
|
||||
* @returns List of files that were modified
|
||||
*/
|
||||
export function updateTemplateFiles(
|
||||
checksDir: string,
|
||||
actionVersionsByWorkflow: ActionVersionsByWorkflow,
|
||||
actionVersions: Record<string, string>,
|
||||
): string[] {
|
||||
const modifiedFiles: string[] = [];
|
||||
|
||||
@@ -205,16 +156,6 @@ export function updateTemplateFiles(
|
||||
let content = fs.readFileSync(filePath, "utf8");
|
||||
const originalContent = content;
|
||||
|
||||
const workflowName = path.basename(filePath);
|
||||
const actionVersions = actionVersionsByWorkflow[workflowName];
|
||||
|
||||
if (actionVersions === undefined) {
|
||||
console.info(
|
||||
`Found no action versions for workflow template '${filePath}'.`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Update action versions
|
||||
for (const [actionName, versionWithComment] of Object.entries(
|
||||
actionVersions,
|
||||
@@ -250,15 +191,12 @@ function main(): number {
|
||||
const verbose = values.verbose ?? false;
|
||||
|
||||
console.info("Scanning generated workflows for latest action versions...");
|
||||
const { actionVersions, actionVersionsByWorkflow } =
|
||||
scanGeneratedWorkflows(WORKFLOW_DIR);
|
||||
const actionVersions = scanGeneratedWorkflows(WORKFLOW_DIR);
|
||||
|
||||
if (verbose) {
|
||||
console.info("Found action versions:");
|
||||
for (const [action, versions] of Object.entries(actionVersions)) {
|
||||
for (const version of versions) {
|
||||
console.info(` ${action}@${version}`);
|
||||
}
|
||||
for (const [action, version] of Object.entries(actionVersions)) {
|
||||
console.info(` ${action}@${version}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,10 +215,7 @@ function main(): number {
|
||||
}
|
||||
|
||||
// Update template files
|
||||
const templateModified = updateTemplateFiles(
|
||||
CHECKS_DIR,
|
||||
actionVersionsByWorkflow,
|
||||
);
|
||||
const templateModified = updateTemplateFiles(CHECKS_DIR, actionVersions);
|
||||
modifiedFiles.push(...templateModified);
|
||||
|
||||
if (modifiedFiles.length > 0) {
|
||||
|
||||
@@ -21,5 +21,5 @@ outputs:
|
||||
environment:
|
||||
description: The inferred build environment configuration.
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: '../lib/resolve-environment-entry.js'
|
||||
|
||||
@@ -51,5 +51,5 @@ outputs:
|
||||
codeql-version:
|
||||
description: The version of the CodeQL binary that was installed.
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: '../lib/setup-codeql-entry.js'
|
||||
|
||||
@@ -13,11 +13,7 @@ import * as diffUtils from "./diff-informed-analysis-utils";
|
||||
import { getEnv } from "./environment";
|
||||
import { Logger } from "./logging";
|
||||
import * as sarif from "./sarif";
|
||||
import {
|
||||
checkExpectedLogMessages,
|
||||
RecordingLogger,
|
||||
setupTests,
|
||||
} from "./testing-utils";
|
||||
import { RecordingLogger, setupTests } from "./testing-utils";
|
||||
import * as uploadLib from "./upload-lib";
|
||||
import { UploadPayload } from "./upload-lib/types";
|
||||
import { GitHubVariant, withTmpDir } from "./util";
|
||||
@@ -1019,62 +1015,12 @@ for (const analysisKind of analyses.supportedAnalysisKinds) {
|
||||
);
|
||||
}
|
||||
|
||||
function createMockSarifWithResults(
|
||||
results: sarif.Result[],
|
||||
): Partial<sarif.Log> {
|
||||
return {
|
||||
version: "2.1.0",
|
||||
runs: [
|
||||
{
|
||||
tool: {
|
||||
driver: {
|
||||
name: "test tool",
|
||||
},
|
||||
},
|
||||
results,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
function createMockResultWithUri(
|
||||
uri: string,
|
||||
startLine = 2,
|
||||
relatedUri?: string,
|
||||
): sarif.Result {
|
||||
return {
|
||||
ruleId: "test-rule",
|
||||
message: { text: "test message" },
|
||||
locations: [
|
||||
{
|
||||
physicalLocation: {
|
||||
artifactLocation: { uri },
|
||||
region: { startLine },
|
||||
},
|
||||
},
|
||||
],
|
||||
...(relatedUri
|
||||
? {
|
||||
relatedLocations: [
|
||||
{
|
||||
physicalLocation: {
|
||||
artifactLocation: { uri: relatedUri },
|
||||
region: { startLine },
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
function runFilterAlertsByDiffRange(
|
||||
input: Partial<sarif.Log>,
|
||||
diffRanges: diffUtils.DiffThunkRange[],
|
||||
logger: Logger = new RecordingLogger(),
|
||||
): Partial<sarif.Log> {
|
||||
sinon.stub(diffUtils, "readDiffRangesJsonFile").returns(diffRanges);
|
||||
return uploadLib.filterAlertsByDiffRange(logger, input);
|
||||
return uploadLib.filterAlertsByDiffRange(new RecordingLogger(), input);
|
||||
}
|
||||
|
||||
test.serial(
|
||||
@@ -1098,139 +1044,3 @@ test.serial(
|
||||
t.deepEqual(actualOutput, expectedOutput);
|
||||
},
|
||||
);
|
||||
|
||||
for (const [filePath, uri] of [
|
||||
["with space/board.js", "with%20space/board.js"],
|
||||
["src/[id]/board.js", "src/%5Bid%5D/board.js"],
|
||||
["src/file#1.js", "src/file%231.js"],
|
||||
["src/100%.js", "src/100%25.js"],
|
||||
["src/literal%20.js", "src/literal%2520.js"],
|
||||
["src/foo:bar.js", "src/foo%3Abar.js"],
|
||||
["src/caf\u00e9.js", "src/caf%C3%A9.js"],
|
||||
["src/caf\u00e9.js", "src/caf%c3%a9.js"],
|
||||
]) {
|
||||
test.serial(
|
||||
`filterAlertsByDiffRange matches percent-encoded URI ${uri}`,
|
||||
(t) => {
|
||||
const matchingResult = createMockResultWithUri(uri);
|
||||
const nonMatchingResult = createMockResultWithUri("other.js");
|
||||
const input = createMockSarifWithResults([
|
||||
matchingResult,
|
||||
nonMatchingResult,
|
||||
]);
|
||||
|
||||
const actualOutput = runFilterAlertsByDiffRange(input, [
|
||||
{ path: filePath, startLine: 1, endLine: 3 },
|
||||
]);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, [matchingResult]);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
test.serial(
|
||||
"filterAlertsByDiffRange filters out percent-encoded URI when outside diff line range",
|
||||
(t) => {
|
||||
const outOfRangeResult = createMockResultWithUri(
|
||||
"with%20space/board.js",
|
||||
2,
|
||||
);
|
||||
const inRangeResult = createMockResultWithUri("with%20space/board.js", 15);
|
||||
const input = createMockSarifWithResults([outOfRangeResult, inRangeResult]);
|
||||
const actualOutput = runFilterAlertsByDiffRange(input, [
|
||||
{ path: "with space/board.js", startLine: 10, endLine: 20 },
|
||||
]);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, [inRangeResult]);
|
||||
},
|
||||
);
|
||||
|
||||
test.serial(
|
||||
"filterAlertsByDiffRange filters out percent-encoded URI when path does not match",
|
||||
(t) => {
|
||||
const input = createMockSarifWithResults([
|
||||
createMockResultWithUri("with%20space/board.js"),
|
||||
]);
|
||||
const actualOutput = runFilterAlertsByDiffRange(input, [
|
||||
{ path: "other/board.js", startLine: 1, endLine: 3 },
|
||||
]);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, []);
|
||||
},
|
||||
);
|
||||
|
||||
test.serial(
|
||||
"filterAlertsByDiffRange keeps alert when relatedLocations has a matching percent-encoded URI",
|
||||
(t) => {
|
||||
const matchingRelatedResult = createMockResultWithUri(
|
||||
"src/promiseUtils.js",
|
||||
2,
|
||||
"with%20space/ParseObject.js",
|
||||
);
|
||||
const nonMatchingResult = createMockResultWithUri("other.js");
|
||||
const input = createMockSarifWithResults([
|
||||
matchingRelatedResult,
|
||||
nonMatchingResult,
|
||||
]);
|
||||
|
||||
const actualOutput = runFilterAlertsByDiffRange(input, [
|
||||
{ path: "with space/ParseObject.js", startLine: 1, endLine: 3 },
|
||||
]);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, [matchingRelatedResult]);
|
||||
},
|
||||
);
|
||||
|
||||
for (const uri of ["dir%ZZ/board.js", "src/bad%.js", "src/bad%C3%28.js"]) {
|
||||
test.serial(
|
||||
`filterAlertsByDiffRange falls back to raw path for malformed URI ${uri}`,
|
||||
(t) => {
|
||||
const logger = new RecordingLogger();
|
||||
const matchingResult = createMockResultWithUri(uri);
|
||||
const input = createMockSarifWithResults([matchingResult]);
|
||||
const actualOutput = runFilterAlertsByDiffRange(
|
||||
input,
|
||||
[{ path: uri, startLine: 1, endLine: 3 }],
|
||||
logger,
|
||||
);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, [matchingResult]);
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
`Failed to decode location URI "${uri}", comparing it as a raw path`,
|
||||
]);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
test.serial(
|
||||
"filterAlertsByDiffRange filters out malformed URI when raw path does not match",
|
||||
(t) => {
|
||||
const logger = new RecordingLogger();
|
||||
const input = createMockSarifWithResults([
|
||||
createMockResultWithUri("dir%ZZ/board.js"),
|
||||
]);
|
||||
const actualOutput = runFilterAlertsByDiffRange(
|
||||
input,
|
||||
[{ path: "src/different.js", startLine: 1, endLine: 3 }],
|
||||
logger,
|
||||
);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, []);
|
||||
checkExpectedLogMessages(t, logger.messages, [
|
||||
'Failed to decode location URI "dir%ZZ/board.js", comparing it as a raw path',
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
test.serial(
|
||||
"filterAlertsByDiffRange matches raw unencoded path containing valid percent-encoding sequence",
|
||||
(t) => {
|
||||
const matchingResult = createMockResultWithUri("dir/100%20done.js");
|
||||
const input = createMockSarifWithResults([matchingResult]);
|
||||
const actualOutput = runFilterAlertsByDiffRange(input, [
|
||||
{ path: "dir/100%20done.js", startLine: 1, endLine: 3 },
|
||||
]);
|
||||
|
||||
t.deepEqual(actualOutput.runs?.[0].results, [matchingResult]);
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1099,21 +1099,9 @@ export function filterAlertsByDiffRange(
|
||||
return locations.some((physicalLocation) => {
|
||||
const locationUri = physicalLocation?.artifactLocation?.uri;
|
||||
const locationStartLine = physicalLocation?.region?.startLine;
|
||||
if (
|
||||
typeof locationUri !== "string" ||
|
||||
!locationUri ||
|
||||
locationStartLine === undefined
|
||||
) {
|
||||
if (!locationUri || locationStartLine === undefined) {
|
||||
return false;
|
||||
}
|
||||
let decodedLocationUri = locationUri;
|
||||
try {
|
||||
decodedLocationUri = decodeURIComponent(locationUri);
|
||||
} catch {
|
||||
logger.debug(
|
||||
`Failed to decode location URI "${locationUri}", comparing it as a raw path`,
|
||||
);
|
||||
}
|
||||
// Alert filtering here replicates the same behavior as the restrictAlertsTo
|
||||
// extensible predicate in CodeQL. See the restrictAlertsTo documentation
|
||||
// https://codeql.github.com/codeql-standard-libraries/csharp/codeql/util/AlertFiltering.qll/predicate.AlertFiltering$restrictAlertsTo.3.html
|
||||
@@ -1121,8 +1109,7 @@ export function filterAlertsByDiffRange(
|
||||
// of an alert location.
|
||||
return diffRanges.some(
|
||||
(range) =>
|
||||
(range.path === decodedLocationUri ||
|
||||
range.path === locationUri) &&
|
||||
range.path === locationUri &&
|
||||
((range.startLine <= locationStartLine &&
|
||||
range.endLine >= locationStartLine) ||
|
||||
(range.startLine === 0 && range.endLine === 0)),
|
||||
|
||||
@@ -29,6 +29,6 @@ outputs:
|
||||
proxy_urls:
|
||||
description: A stringified JSON array of objects containing the types and URLs of the configured registries.
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: "../lib/start-proxy-entry.js"
|
||||
post: "../lib/start-proxy-post-entry.js"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
- Fixed diff-informed alert filtering incorrectly removing alerts in changed files whose paths contain spaces, special characters, or non-ASCII characters. [#4283](https://github.com/github/codeql-action/pull/4283)
|
||||
@@ -41,6 +41,6 @@ outputs:
|
||||
|
||||
{ "code-scanning": "some-id", "code-quality": "some-other-id" }
|
||||
runs:
|
||||
using: node24
|
||||
using: node20
|
||||
main: '../lib/upload-sarif-entry.js'
|
||||
post: '../lib/upload-sarif-post-entry.js'
|
||||
|
||||
Reference in New Issue
Block a user