mirror of
https://github.com/github/codeql-action.git
synced 2026-08-05 21:06:13 -05:00
Compare commits
322 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c4dd10e44a | |||
| 2ba473f582 | |||
| b4d147f9bc | |||
| f6580d2b8f | |||
| 5e7686d132 | |||
| 324dd69df0 | |||
| 200d550080 | |||
| 5595ccaf91 | |||
| ec9c75796a | |||
| 45c8742e17 | |||
| 6a9359a1bd | |||
| 065cdc0394 | |||
| f99dd5aeee | |||
| 1804b211a3 | |||
| e60ea984bd | |||
| 01b30f9112 | |||
| f44d029dbc | |||
| a7b3986136 | |||
| 5667eabe3b | |||
| 2c538e6403 | |||
| 3020a2f462 | |||
| 93c3a5a40b | |||
| d1ba80a13d | |||
| e74600b0d9 | |||
| 266c7bdbd2 | |||
| daa7fe6fba | |||
| 1cd4d01d58 | |||
| d2bfc30bc3 | |||
| 68028fcb16 | |||
| fa3b8d4aca | |||
| c29563eeaa | |||
| 155e522997 | |||
| 2d3b351ea6 | |||
| 85722ca3f8 | |||
| 93539ac81b | |||
| a2225dced3 | |||
| 4d950cddc8 | |||
| b7ae332965 | |||
| 5d3eb98e4a | |||
| c5f739bd64 | |||
| a2983b8bed | |||
| 30d6d12c17 | |||
| 2e53f1cea2 | |||
| d0ee43ac62 | |||
| 14e2e60bf8 | |||
| 5d3f01e177 | |||
| 3f405c7726 | |||
| 19d11a3383 | |||
| 06f1d4ffed | |||
| 82f035a501 | |||
| f205ea1c33 | |||
| 60a57910be | |||
| 3502f79575 | |||
| 8f0a4f23c4 | |||
| 780c00da3f | |||
| f02afd42b0 | |||
| d57c3ffcba | |||
| e40d079dd9 | |||
| 8e6fdffc32 | |||
| ba46ff760e | |||
| b411bbcd4a | |||
| 9130ce0f73 | |||
| 0cebd1d28d | |||
| d2f5cbbe91 | |||
| c62d824686 | |||
| da0c190101 | |||
| 36737508ec | |||
| 30c33c9286 | |||
| 3ca82bb259 | |||
| 42a3b94790 | |||
| 13d4882649 | |||
| e55a57b808 | |||
| 51d51e8121 | |||
| e893985e8b | |||
| eb692f8b49 | |||
| aac07d2a41 | |||
| de57c4a441 | |||
| 2e251072b0 | |||
| 94a12eb6f6 | |||
| e28cbacfa1 | |||
| 60834a0cd9 | |||
| e9831f72a2 | |||
| 766928d055 | |||
| 049af32c59 | |||
| c7ae51bb2d | |||
| 1f9caf0118 | |||
| 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 |
@@ -16,5 +16,5 @@ inputs:
|
|||||||
Comma separated list of query ids that should NOT be included in this SARIF file.
|
Comma separated list of query ids that should NOT be included in this SARIF file.
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: index.js
|
main: index.js
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: Verify that the best-effort debug artifact scan completed
|
name: Verify that the best-effort debug artifact scan completed
|
||||||
description: Verifies that the best-effort debug artifact scan completed successfully during tests
|
description: Verifies that the best-effort debug artifact scan completed successfully during tests
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: index.js
|
main: index.js
|
||||||
post: post.js
|
post: post.js
|
||||||
|
|||||||
+2
-2
@@ -71,8 +71,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd "$RUNNER_TEMP/results"
|
cd "$RUNNER_TEMP/results"
|
||||||
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
|
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
|
||||||
if [[ "$actual" != "$JOB_RUN_UUID" ]]; then
|
if [[ "$actual" != "$CODEQL_ACTION_JOB_RUN_UUID" ]]; then
|
||||||
echo "Expected SARIF output to contain job run UUID '$JOB_RUN_UUID', but found '$actual'."
|
echo "Expected SARIF output to contain job run UUID '$CODEQL_ACTION_JOB_RUN_UUID', but found '$actual'."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Found job run UUID '$actual'."
|
echo "Found job run UUID '$actual'."
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ jobs:
|
|||||||
use-all-platform-bundle: 'false'
|
use-all-platform-bundle: 'false'
|
||||||
setup-kotlin: 'true'
|
setup-kotlin: 'true'
|
||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0
|
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
||||||
with:
|
with:
|
||||||
ruby-version: 2.6
|
ruby-version: 2.6
|
||||||
- name: Install Code Scanning integration
|
- name: Install Code Scanning integration
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||||
with:
|
with:
|
||||||
repository: github/enterprise-releases
|
repository: github/enterprise-releases
|
||||||
token: ${{ secrets.ENTERPRISE_RELEASE_TOKEN }}
|
token: ${{ secrets.CODEQL_CI_ENTERPRISE_RELEASE_PAT }}
|
||||||
path: ${{ github.workspace }}/enterprise-releases/
|
path: ${{ github.workspace }}/enterprise-releases/
|
||||||
sparse-checkout: releases.json
|
sparse-checkout: releases.json
|
||||||
|
|
||||||
|
|||||||
+50
-41
@@ -2,61 +2,70 @@
|
|||||||
|
|
||||||
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
|
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
|
||||||
|
|
||||||
## [UNRELEASED]
|
## 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)
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
## 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)
|
- 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.
|
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 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)
|
- 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)
|
- _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)
|
- 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)
|
- 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)
|
- 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.
|
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)
|
- 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)
|
- 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)
|
- 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.
|
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)
|
- _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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- _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)
|
- Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. [#3850](https://github.com/github/codeql-action/pull/3850)
|
||||||
@@ -64,7 +73,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)
|
- 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)
|
- 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 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)
|
- 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)
|
||||||
@@ -72,26 +81,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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
||||||
|
|
||||||
@@ -105,11 +114,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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
||||||
@@ -119,7 +128,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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
||||||
@@ -127,89 +136,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 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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.
|
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)
|
- 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)
|
- 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.
|
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)
|
- 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.
|
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/).
|
- 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)
|
- 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.
|
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.
|
- 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)
|
- 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)
|
- 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)
|
- 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)
|
- 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.
|
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
|
## 3.30.6 - 02 Oct 2025
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.23.2. [#3168](https://github.com/github/codeql-action/pull/3168)
|
- Update default CodeQL bundle version to 2.23.2. [#3168](https://github.com/github/codeql-action/pull/3168)
|
||||||
|
|||||||
+1
-1
@@ -94,6 +94,6 @@ outputs:
|
|||||||
sarif-id:
|
sarif-id:
|
||||||
description: The ID of the uploaded SARIF file.
|
description: The ID of the uploaded SARIF file.
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: "../lib/analyze-entry.js"
|
main: "../lib/analyze-entry.js"
|
||||||
post: "../lib/analyze-post-entry.js"
|
post: "../lib/analyze-post-entry.js"
|
||||||
|
|||||||
@@ -15,5 +15,5 @@ inputs:
|
|||||||
$GITHUB_WORKSPACE as its working directory.
|
$GITHUB_WORKSPACE as its working directory.
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: '../lib/autobuild-entry.js'
|
main: '../lib/autobuild-entry.js'
|
||||||
|
|||||||
+1
-1
@@ -170,6 +170,6 @@ outputs:
|
|||||||
codeql-version:
|
codeql-version:
|
||||||
description: The version of the CodeQL binary used for analysis
|
description: The version of the CodeQL binary used for analysis
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: '../lib/init-entry.js'
|
main: '../lib/init-entry.js'
|
||||||
post: '../lib/init-post-entry.js'
|
post: '../lib/init-post-entry.js'
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bundleVersion": "codeql-bundle-v2.26.1",
|
"bundleVersion": "codeql-bundle-v2.26.2",
|
||||||
"cliVersion": "2.26.1",
|
"cliVersion": "2.26.2",
|
||||||
"priorBundleVersion": "codeql-bundle-v2.26.0",
|
"priorBundleVersion": "codeql-bundle-v2.26.1",
|
||||||
"priorCliVersion": "2.26.0"
|
"priorCliVersion": "2.26.1"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+505
-420
File diff suppressed because it is too large
Load Diff
Generated
+80
-80
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "codeql",
|
"name": "codeql",
|
||||||
"version": "4.37.4",
|
"version": "4.37.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "codeql",
|
"name": "codeql",
|
||||||
"version": "4.37.4",
|
"version": "4.37.6",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"pr-checks"
|
"pr-checks"
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
"follow-redirects": "^1.16.0",
|
"follow-redirects": "^1.16.0",
|
||||||
"get-folder-size": "^5.0.0",
|
"get-folder-size": "^5.0.0",
|
||||||
"https-proxy-agent": "^7.0.6",
|
"https-proxy-agent": "^7.0.6",
|
||||||
"js-yaml": "^5.2.1",
|
"js-yaml": "^5.2.2",
|
||||||
"jsonschema": "1.5.0",
|
"jsonschema": "1.5.0",
|
||||||
"long": "^5.3.2",
|
"long": "^5.3.2",
|
||||||
"node-forge": "^1.4.0",
|
"node-forge": "^1.4.0",
|
||||||
@@ -63,9 +63,9 @@
|
|||||||
"glob": "^13.0.6",
|
"glob": "^13.0.6",
|
||||||
"globals": "^17.7.0",
|
"globals": "^17.7.0",
|
||||||
"nock": "^14.0.16",
|
"nock": "^14.0.16",
|
||||||
"sinon": "^22.0.0",
|
"sinon": "^22.1.0",
|
||||||
"typescript": "^6.0.3",
|
"typescript": "^6.0.3",
|
||||||
"typescript-eslint": "^8.64.0"
|
"typescript-eslint": "^8.65.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
"node_modules/@aashutoshrathi/word-wrap": {
|
||||||
@@ -2591,17 +2591,17 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.65.0.tgz",
|
||||||
"integrity": "sha512-CGvQPBxN3wZLu6Rz2kFUpZeoCm78xUic92ck39KPePkO1NPOwjCqdQnm5Q87tpWw9vcBvW8XLrDXjH9PWYtJ3Q==",
|
"integrity": "sha512-IEgob78X12rHpUmtcwFsXhZdVGJtwTVP8FiCLZkR6GlYVrl2PcuB+KhCE5BlVC/eQpQnu8WXRtkHZuPar+gCRA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@typescript-eslint/scope-manager": "8.64.0",
|
"@typescript-eslint/scope-manager": "8.65.0",
|
||||||
"@typescript-eslint/type-utils": "8.64.0",
|
"@typescript-eslint/type-utils": "8.65.0",
|
||||||
"@typescript-eslint/utils": "8.64.0",
|
"@typescript-eslint/utils": "8.65.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.64.0",
|
"@typescript-eslint/visitor-keys": "8.65.0",
|
||||||
"ignore": "^7.0.5",
|
"ignore": "^7.0.5",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"ts-api-utils": "^2.5.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
@@ -2614,7 +2614,7 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/parser": "^8.64.0",
|
"@typescript-eslint/parser": "^8.65.0",
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.1.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
@@ -2630,16 +2630,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.65.0.tgz",
|
||||||
"integrity": "sha512-KA0OshtlcCCXmbfqyZkM5pV3/WNraJf7DkJRLpyrmwPtud57H5BDX7C3k0LPSPxpprfRL+cJDGabF10mvNCoCw==",
|
"integrity": "sha512-CZ4nMxWwgu1HEEFNkeaCptra9QCtkmKdgf3sWh1rl1trIhmxLilgTV4cwcbQ4wemnT4sWQN8CaKOmdYx+g2gMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.64.0",
|
"@typescript-eslint/scope-manager": "8.65.0",
|
||||||
"@typescript-eslint/types": "8.64.0",
|
"@typescript-eslint/types": "8.65.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.64.0",
|
"@typescript-eslint/typescript-estree": "8.65.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.64.0",
|
"@typescript-eslint/visitor-keys": "8.65.0",
|
||||||
"debug": "^4.4.3"
|
"debug": "^4.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2673,14 +2673,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/project-service": {
|
"node_modules/@typescript-eslint/project-service": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.65.0.tgz",
|
||||||
"integrity": "sha512-tk4WpOJ6IEbGrVHaNmM0YRrwAD3exZlIK3iadQNAxh4YKk6jvUQ4ecq18n+v7+meh+cJ3j+D8nbk8sRKhlwLQg==",
|
"integrity": "sha512-SxnPhbTsGahizDgbu7oqFH/xVtzIqMd/s+WtnSxNxJZJpLbdT5IPdzg8EZxO3+PoKahXmwJLeNQOpKJb3/bi7Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/tsconfig-utils": "^8.64.0",
|
"@typescript-eslint/tsconfig-utils": "^8.65.0",
|
||||||
"@typescript-eslint/types": "^8.64.0",
|
"@typescript-eslint/types": "^8.65.0",
|
||||||
"debug": "^4.4.3"
|
"debug": "^4.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2713,14 +2713,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.65.0.tgz",
|
||||||
"integrity": "sha512-CXEaFdYXjSTgKhisNkwCcJwTP8Pl+fmRrEQrri4nm3vU743bALrxzLmq7fHG/7e6a5xO0lDYeURpZmBuhHk54w==",
|
"integrity": "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.64.0",
|
"@typescript-eslint/types": "8.65.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.64.0"
|
"@typescript-eslint/visitor-keys": "8.65.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -2731,9 +2731,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.65.0.tgz",
|
||||||
"integrity": "sha512-2yo8rRNKuzbVWQp5kslhANqZ2uDAeROQHBRZNPu8JDsHmeFNj/XJJhX/FhNUWmkHHvoNsKa6+tHJiig87EzsQw==",
|
"integrity": "sha512-j6GzGqCiRdA7Qhur2VVmKZAkBLfnHFQfx4TaJGL9RMveZqCo48jSHHO0DTgizEnGhtWnqmbtCUSrqSkdiY/0Hg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2748,15 +2748,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.65.0.tgz",
|
||||||
"integrity": "sha512-XWG4Fmmv/6SvyS9nH8jWrKs6terwJvE8cyRt1CzYYqzp9OrPhCT4cMc/f7C6RZCwG+qMmiffJS1/qJP8G1URtg==",
|
"integrity": "sha512-YjaZ7PRI5qY7ax2L3PbvX0rRyGtipAReCWs0mhhDBHjH/vl0g0BonaGXrKdKpMbIIsMIwDgbk/xzkBTyAltS5g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.64.0",
|
"@typescript-eslint/types": "8.65.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.64.0",
|
"@typescript-eslint/typescript-estree": "8.65.0",
|
||||||
"@typescript-eslint/utils": "8.64.0",
|
"@typescript-eslint/utils": "8.65.0",
|
||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"ts-api-utils": "^2.5.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
},
|
},
|
||||||
@@ -2791,9 +2791,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.65.0.tgz",
|
||||||
"integrity": "sha512-qjhfuTfLXjA4IOzXvz0rTjT01BqEiIgPoUeMwiEjnaHKJMTNo8rH5pYW1a2L/0Dnux2fPC85AeyJoWaGa8WxTA==",
|
"integrity": "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2805,16 +2805,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.65.0.tgz",
|
||||||
"integrity": "sha512-Pztpsn1aCE1oWDvDEfUk31nngvvF7vUB5SwHFEaZIFpvw7WJtqUHHL4plBZDA9HfWJJjL13BdG0YrJInTUvoVA==",
|
"integrity": "sha512-JboAE2swaYt4tb1fHhHTABE2K+OLy09XfcTbhnk4Pw96f9dd2e9iYsJ28gBggHlo5z5x1rkyWvcPoTuNTd4oGg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/project-service": "8.64.0",
|
"@typescript-eslint/project-service": "8.65.0",
|
||||||
"@typescript-eslint/tsconfig-utils": "8.64.0",
|
"@typescript-eslint/tsconfig-utils": "8.65.0",
|
||||||
"@typescript-eslint/types": "8.64.0",
|
"@typescript-eslint/types": "8.65.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.64.0",
|
"@typescript-eslint/visitor-keys": "8.65.0",
|
||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"minimatch": "^10.2.2",
|
"minimatch": "^10.2.2",
|
||||||
"semver": "^7.7.3",
|
"semver": "^7.7.3",
|
||||||
@@ -2843,16 +2843,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
||||||
"version": "5.0.7",
|
"version": "5.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
|
||||||
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
|
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^4.0.2"
|
"balanced-match": "^4.0.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18 || 20 || >=22"
|
"node": "20 || >=22"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
|
"node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
|
||||||
@@ -2874,13 +2874,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
|
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
|
||||||
"version": "10.2.5",
|
"version": "10.2.6",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
|
||||||
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
|
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BlueOak-1.0.0",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^5.0.5"
|
"brace-expansion": "^5.0.8"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18 || 20 || >=22"
|
"node": "18 || 20 || >=22"
|
||||||
@@ -2890,16 +2890,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.65.0.tgz",
|
||||||
"integrity": "sha512-aJUGVB3+U0htrrCjoA8qukw8cm8fNCGAxK/tVoS70k8aeb7DETKeFozRiVFIwEeN9WJLsjaP3ph8I60tY2XZoQ==",
|
"integrity": "sha512-gXiwIHsYreboxeJucHKPvgwl7dXt50mF8s1/c00cP/WoVTyWKFdtfhRWwZiXYFU5H2O8vVoSLNrexFZjYS/SGA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.9.1",
|
"@eslint-community/eslint-utils": "^4.9.1",
|
||||||
"@typescript-eslint/scope-manager": "8.64.0",
|
"@typescript-eslint/scope-manager": "8.65.0",
|
||||||
"@typescript-eslint/types": "8.64.0",
|
"@typescript-eslint/types": "8.65.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.64.0"
|
"@typescript-eslint/typescript-estree": "8.65.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -2914,13 +2914,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.65.0.tgz",
|
||||||
"integrity": "sha512-mrtuL8Nsn6gi2H4mo5KMTp823M+3Q19Ew/i+Zlikq20tIMm99C3Ez0dCmkWWnxut20esQvTg8aUSEhMcAOXhEw==",
|
"integrity": "sha512-8C71BQkGjiMmXtop7pHVJu1l2NNShFdkCyD6a2ezzs5vU/L3LRtb69EtcteFwz0mYMPzIgOw0n6OV4VBUWZd7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.64.0",
|
"@typescript-eslint/types": "8.65.0",
|
||||||
"eslint-visitor-keys": "^5.0.0"
|
"eslint-visitor-keys": "^5.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -6981,9 +6981,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
"version": "5.2.1",
|
"version": "5.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.2.tgz",
|
||||||
"integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==",
|
"integrity": "sha512-dayzUzKkJ1MkuUtZglSebU43utNXH0OWQByK9rKOOuYIO8M5TV1y+n8ALMdG0rdzBnfNkOmZEqrURepb0ejqBw==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "github",
|
"type": "github",
|
||||||
@@ -8556,9 +8556,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sinon": {
|
"node_modules/sinon": {
|
||||||
"version": "22.0.0",
|
"version": "22.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-22.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/sinon/-/sinon-22.1.0.tgz",
|
||||||
"integrity": "sha512-sq/6DpdXOrLyfbKlXLg/Usc7xu8YXPeLkOFZRvA3bNUSA2lhbrZ06yuXbH1fkzBPCbz9O10+7hznzUsjaYNm0Q==",
|
"integrity": "sha512-n1ajF2rBWMTtEwbKcw4UdFg4nCnDdq/U6RDoxtOd7oapOlRoJ5ynwFx60owROyhDpA9QhMZi0pCO/xtmwFjG7w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -9320,16 +9320,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript-eslint": {
|
"node_modules/typescript-eslint": {
|
||||||
"version": "8.64.0",
|
"version": "8.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.64.0.tgz",
|
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.65.0.tgz",
|
||||||
"integrity": "sha512-0qg+pDNMnqYzqH9AnNK+39tejHvsShUOUUoRUgtnTGE7QuMZhiFDnozq8nHJVq+Wae6NMLKNWLg5WmkcC/ndyQ==",
|
"integrity": "sha512-/ggrHAwyjENDusvyxbuqxAC2dTnZg/Z8F+fgQtYIz+L6n/9HfSlEZcFGV/NsMNa6CkGk0xUjUAFwC0vHOflvIA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "8.64.0",
|
"@typescript-eslint/eslint-plugin": "8.65.0",
|
||||||
"@typescript-eslint/parser": "8.64.0",
|
"@typescript-eslint/parser": "8.65.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.64.0",
|
"@typescript-eslint/typescript-estree": "8.65.0",
|
||||||
"@typescript-eslint/utils": "8.64.0"
|
"@typescript-eslint/utils": "8.65.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "codeql",
|
"name": "codeql",
|
||||||
"version": "4.37.4",
|
"version": "3.37.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "CodeQL action",
|
"description": "CodeQL action",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
"follow-redirects": "^1.16.0",
|
"follow-redirects": "^1.16.0",
|
||||||
"get-folder-size": "^5.0.0",
|
"get-folder-size": "^5.0.0",
|
||||||
"https-proxy-agent": "^7.0.6",
|
"https-proxy-agent": "^7.0.6",
|
||||||
"js-yaml": "^5.2.1",
|
"js-yaml": "^5.2.2",
|
||||||
"jsonschema": "1.5.0",
|
"jsonschema": "1.5.0",
|
||||||
"long": "^5.3.2",
|
"long": "^5.3.2",
|
||||||
"node-forge": "^1.4.0",
|
"node-forge": "^1.4.0",
|
||||||
@@ -71,9 +71,9 @@
|
|||||||
"glob": "^13.0.6",
|
"glob": "^13.0.6",
|
||||||
"globals": "^17.7.0",
|
"globals": "^17.7.0",
|
||||||
"nock": "^14.0.16",
|
"nock": "^14.0.16",
|
||||||
"sinon": "^22.0.0",
|
"sinon": "^22.1.0",
|
||||||
"typescript": "^6.0.3",
|
"typescript": "^6.0.3",
|
||||||
"typescript-eslint": "^8.64.0"
|
"typescript-eslint": "^8.65.0"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@actions/tool-cache": {
|
"@actions/tool-cache": {
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ steps:
|
|||||||
run: |
|
run: |
|
||||||
cd "$RUNNER_TEMP/results"
|
cd "$RUNNER_TEMP/results"
|
||||||
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
|
actual=$(jq -r '.runs[0].properties.jobRunUuid' javascript.sarif)
|
||||||
if [[ "$actual" != "$JOB_RUN_UUID" ]]; then
|
if [[ "$actual" != "$CODEQL_ACTION_JOB_RUN_UUID" ]]; then
|
||||||
echo "Expected SARIF output to contain job run UUID '$JOB_RUN_UUID', but found '$actual'."
|
echo "Expected SARIF output to contain job run UUID '$CODEQL_ACTION_JOB_RUN_UUID', but found '$actual'."
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo "Found job run UUID '$actual'."
|
echo "Found job run UUID '$actual'."
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ versions:
|
|||||||
- default
|
- default
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Ruby
|
- name: Set up Ruby
|
||||||
uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0
|
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
||||||
with:
|
with:
|
||||||
ruby-version: 2.6
|
ruby-version: 2.6
|
||||||
- name: Install Code Scanning integration
|
- name: Install Code Scanning integration
|
||||||
|
|||||||
@@ -21,5 +21,5 @@ outputs:
|
|||||||
environment:
|
environment:
|
||||||
description: The inferred build environment configuration.
|
description: The inferred build environment configuration.
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: '../lib/resolve-environment-entry.js'
|
main: '../lib/resolve-environment-entry.js'
|
||||||
|
|||||||
@@ -54,5 +54,5 @@ outputs:
|
|||||||
codeql-version:
|
codeql-version:
|
||||||
description: The version of the CodeQL binary that was installed.
|
description: The version of the CodeQL binary that was installed.
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: '../lib/setup-codeql-entry.js'
|
main: '../lib/setup-codeql-entry.js'
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
import * as core from "@actions/core";
|
||||||
|
import test from "ava";
|
||||||
|
import sinon from "sinon";
|
||||||
|
|
||||||
|
import * as common from "./action-common";
|
||||||
|
import * as actionsUtil from "./actions-util";
|
||||||
|
import * as environment from "./environment";
|
||||||
|
import * as logging from "./logging";
|
||||||
|
import { ActionName } from "./status-report";
|
||||||
|
import * as statusReport from "./status-report";
|
||||||
|
import {
|
||||||
|
getTestActionsEnv,
|
||||||
|
getTestEnv,
|
||||||
|
makeMacro,
|
||||||
|
RecordingLogger,
|
||||||
|
setupTests,
|
||||||
|
} from "./testing-utils";
|
||||||
|
import { getErrorMessage } from "./util";
|
||||||
|
|
||||||
|
setupTests(test);
|
||||||
|
|
||||||
|
interface RunInActionsTestOpts {
|
||||||
|
runFn?: () => Promise<any>;
|
||||||
|
expectedErrorMessage?: string;
|
||||||
|
expectedTelemetryError?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const runInActionsMacro = makeMacro({
|
||||||
|
exec: async (t, opts: RunInActionsTestOpts) => {
|
||||||
|
const expectFailure = opts?.expectedErrorMessage !== undefined;
|
||||||
|
|
||||||
|
const logger = new RecordingLogger();
|
||||||
|
const getActionsLogger = sinon
|
||||||
|
.stub(logging, "getActionsLogger")
|
||||||
|
.returns(logger);
|
||||||
|
|
||||||
|
const env = getTestEnv();
|
||||||
|
const getEnv = sinon.stub(environment, "getEnv").returns(env);
|
||||||
|
|
||||||
|
const actionsEnv = getTestActionsEnv(env);
|
||||||
|
const getActionsEnv = sinon
|
||||||
|
.stub(actionsUtil, "getActionsEnv")
|
||||||
|
.returns(actionsEnv);
|
||||||
|
|
||||||
|
const getJobUUID = sinon
|
||||||
|
.stub(statusReport, "getJobUUID")
|
||||||
|
.returns("test-job-uuid");
|
||||||
|
|
||||||
|
const setFailed = sinon.stub(core, "setFailed");
|
||||||
|
const sendUnhandledErrorStatusReport = sinon.stub(
|
||||||
|
statusReport,
|
||||||
|
"sendUnhandledErrorStatusReport",
|
||||||
|
);
|
||||||
|
|
||||||
|
const name = ActionName.Init;
|
||||||
|
const run = sinon.stub();
|
||||||
|
|
||||||
|
if (opts?.runFn) {
|
||||||
|
run.callsFake(opts.runFn);
|
||||||
|
}
|
||||||
|
|
||||||
|
const transformTelemetryError = sinon
|
||||||
|
.stub()
|
||||||
|
.callsFake((err) => opts?.expectedTelemetryError ?? getErrorMessage(err));
|
||||||
|
const testAction: common.Action = {
|
||||||
|
name,
|
||||||
|
run,
|
||||||
|
transformTelemetryError,
|
||||||
|
};
|
||||||
|
|
||||||
|
await common.runInActions(testAction);
|
||||||
|
|
||||||
|
// These always should have been called once.
|
||||||
|
t.true(getActionsLogger.calledOnce);
|
||||||
|
t.true(getEnv.calledOnce);
|
||||||
|
t.true(getActionsEnv.calledOnce);
|
||||||
|
|
||||||
|
const expectedActionState = {
|
||||||
|
actions: actionsEnv,
|
||||||
|
env,
|
||||||
|
logger,
|
||||||
|
name: ActionName.Init,
|
||||||
|
};
|
||||||
|
|
||||||
|
t.true(getJobUUID.calledOnceWithExactly(sinon.match(expectedActionState)));
|
||||||
|
t.true(run.calledOnceWithExactly(sinon.match(expectedActionState)));
|
||||||
|
|
||||||
|
t.is(setFailed.calledOnce, expectFailure ?? false);
|
||||||
|
t.is(sendUnhandledErrorStatusReport.calledOnce, expectFailure ?? false);
|
||||||
|
|
||||||
|
if (expectFailure) {
|
||||||
|
t.true(
|
||||||
|
setFailed.calledOnceWithExactly(
|
||||||
|
`${statusReport.getDisplayActionName(name)} action failed: ${opts?.expectedErrorMessage}`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
t.true(
|
||||||
|
sendUnhandledErrorStatusReport.calledOnceWithExactly(
|
||||||
|
name,
|
||||||
|
sinon.match.any,
|
||||||
|
opts?.expectedTelemetryError ?? opts?.expectedErrorMessage,
|
||||||
|
logger,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: (providedTitle) => `runInActions - ${providedTitle}`,
|
||||||
|
});
|
||||||
|
|
||||||
|
runInActionsMacro.serial("calls run", {});
|
||||||
|
runInActionsMacro.serial("handles run exceptions", {
|
||||||
|
runFn: () => {
|
||||||
|
throw new Error("Test failure");
|
||||||
|
},
|
||||||
|
expectedErrorMessage: "Test failure",
|
||||||
|
});
|
||||||
|
runInActionsMacro.serial("transforms run exceptions", {
|
||||||
|
runFn: () => {
|
||||||
|
throw new Error("Test failure");
|
||||||
|
},
|
||||||
|
expectedErrorMessage: "Test failure",
|
||||||
|
expectedTelemetryError: "Transformed failure message",
|
||||||
|
});
|
||||||
+26
-4
@@ -8,9 +8,10 @@ import { getActionsLogger, Logger } from "./logging";
|
|||||||
import {
|
import {
|
||||||
ActionName,
|
ActionName,
|
||||||
getDisplayActionName,
|
getDisplayActionName,
|
||||||
|
getJobUUID,
|
||||||
sendUnhandledErrorStatusReport,
|
sendUnhandledErrorStatusReport,
|
||||||
} from "./status-report";
|
} from "./status-report";
|
||||||
import { getEnv, getErrorMessage } from "./util";
|
import { getEnv, getErrorMessage, wrapError } from "./util";
|
||||||
|
|
||||||
/** Base state that is available to an Action on startup. */
|
/** Base state that is available to an Action on startup. */
|
||||||
export interface BaseState {
|
export interface BaseState {
|
||||||
@@ -78,6 +79,12 @@ export interface Action {
|
|||||||
name: ActionName;
|
name: ActionName;
|
||||||
/** The entry point for the Action. */
|
/** The entry point for the Action. */
|
||||||
run: ActionMain;
|
run: ActionMain;
|
||||||
|
/**
|
||||||
|
* An optional function that transforms a caught error into a message suitable for
|
||||||
|
* inclusion in a status report. This is primarily intended for the `start-proxy`
|
||||||
|
* action to replace the thrown `Error`'s message with a safe one.
|
||||||
|
*/
|
||||||
|
transformTelemetryError?: (error: Error) => string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A generic entry point that sets up the basic environment for the `action` and runs it. */
|
/** A generic entry point that sets up the basic environment for the `action` and runs it. */
|
||||||
@@ -88,17 +95,32 @@ export async function runInActions(action: Action) {
|
|||||||
const actionsEnv = getActionsEnv();
|
const actionsEnv = getActionsEnv();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await action.run({
|
const actionState = {
|
||||||
name: action.name,
|
name: action.name,
|
||||||
startedAt,
|
startedAt,
|
||||||
logger,
|
logger,
|
||||||
env,
|
env,
|
||||||
actions: actionsEnv,
|
actions: actionsEnv,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
// Create a unique identifier for this run.
|
||||||
|
getJobUUID(actionState);
|
||||||
|
|
||||||
|
await action.run(actionState);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(
|
core.setFailed(
|
||||||
`${getDisplayActionName(action.name)} action failed: ${getErrorMessage(error)}`,
|
`${getDisplayActionName(action.name)} action failed: ${getErrorMessage(error)}`,
|
||||||
);
|
);
|
||||||
await sendUnhandledErrorStatusReport(action.name, startedAt, error, logger);
|
|
||||||
|
const statusReportError =
|
||||||
|
action.transformTelemetryError !== undefined
|
||||||
|
? action.transformTelemetryError(wrapError(error))
|
||||||
|
: error;
|
||||||
|
await sendUnhandledErrorStatusReport(
|
||||||
|
action.name,
|
||||||
|
startedAt,
|
||||||
|
statusReportError,
|
||||||
|
logger,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-1
@@ -27,14 +27,20 @@ declare const __CODEQL_ACTION_VERSION__: string;
|
|||||||
* global functions in tests.
|
* global functions in tests.
|
||||||
*/
|
*/
|
||||||
export interface ActionsEnv {
|
export interface ActionsEnv {
|
||||||
|
getRequiredInput: (name: string) => string;
|
||||||
getOptionalInput: (name: string) => string | undefined;
|
getOptionalInput: (name: string) => string | undefined;
|
||||||
|
exportVariable: (name: string, value: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the real `ActionsEnv` used by production code.
|
* Gets the real `ActionsEnv` used by production code.
|
||||||
*/
|
*/
|
||||||
export function getActionsEnv(): ActionsEnv {
|
export function getActionsEnv(): ActionsEnv {
|
||||||
return { getOptionalInput };
|
return {
|
||||||
|
getRequiredInput,
|
||||||
|
getOptionalInput,
|
||||||
|
exportVariable: core.exportVariable,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import test from "ava";
|
import test from "ava";
|
||||||
import sinon from "sinon";
|
import sinon from "sinon";
|
||||||
|
|
||||||
import { getActionsEnv } from "../actions-util";
|
import { ActionsEnv } from "../actions-util";
|
||||||
import { Feature } from "../feature-flags";
|
import { Feature } from "../feature-flags";
|
||||||
import { RepositoryPropertyName } from "../feature-flags/properties";
|
import { RepositoryPropertyName } from "../feature-flags/properties";
|
||||||
import { callee } from "../testing-utils";
|
import { callee } from "../testing-utils";
|
||||||
@@ -22,32 +22,26 @@ const expectedRepositoryPropertyResult: ComputedInput = {
|
|||||||
value: "repo-property-input-value",
|
value: "repo-property-input-value",
|
||||||
};
|
};
|
||||||
|
|
||||||
function stubGetToolsInput() {
|
function stubGetToolsInput(actions: ActionsEnv) {
|
||||||
const actions = getActionsEnv();
|
|
||||||
sinon
|
sinon
|
||||||
.stub(actions, "getOptionalInput")
|
.stub(actions, "getOptionalInput")
|
||||||
.withArgs(InputName.Tools)
|
.withArgs(InputName.Tools)
|
||||||
.returns(expectedWorkflowResult.value);
|
.returns(expectedWorkflowResult.value);
|
||||||
return actions;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const workflowLogMessage = `Using ${InputName.Tools} input from workflow:`;
|
const workflowLogMessage = `Using ${InputName.Tools} input from workflow:`;
|
||||||
|
|
||||||
test("getToolsInput - returns workflow input if available", async (t) => {
|
test("getToolsInput - returns workflow input if available", async (t) => {
|
||||||
const actions = stubGetToolsInput();
|
|
||||||
|
|
||||||
await callee(getToolsInput)
|
await callee(getToolsInput)
|
||||||
.withActions(actions)
|
.withActions(stubGetToolsInput)
|
||||||
.withArgs({})
|
.withArgs({})
|
||||||
.logs(t, workflowLogMessage)
|
.logs(t, workflowLogMessage)
|
||||||
.passes(t.deepEqual, expectedWorkflowResult);
|
.passes(t.deepEqual, expectedWorkflowResult);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getToolsInput - returns repository property value if enforced", async (t) => {
|
test("getToolsInput - returns repository property value if enforced", async (t) => {
|
||||||
const actions = stubGetToolsInput();
|
|
||||||
|
|
||||||
const target = callee(getToolsInput)
|
const target = callee(getToolsInput)
|
||||||
.withActions(actions)
|
.withActions(stubGetToolsInput)
|
||||||
.withArgs({
|
.withArgs({
|
||||||
[RepositoryPropertyName.TOOLS]: `!${expectedRepositoryPropertyResult.value}`,
|
[RepositoryPropertyName.TOOLS]: `!${expectedRepositoryPropertyResult.value}`,
|
||||||
});
|
});
|
||||||
@@ -65,10 +59,8 @@ test("getToolsInput - returns repository property value if enforced", async (t)
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("getToolsInput - prefers workflow input", async (t) => {
|
test("getToolsInput - prefers workflow input", async (t) => {
|
||||||
const actions = stubGetToolsInput();
|
|
||||||
|
|
||||||
const target = callee(getToolsInput)
|
const target = callee(getToolsInput)
|
||||||
.withActions(actions)
|
.withActions(stubGetToolsInput)
|
||||||
.withArgs({
|
.withArgs({
|
||||||
[RepositoryPropertyName.TOOLS]: expectedRepositoryPropertyResult.value,
|
[RepositoryPropertyName.TOOLS]: expectedRepositoryPropertyResult.value,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export interface RemoteFileAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** The default file path to use in configuration file shorthands. */
|
/** The default file path to use in configuration file shorthands. */
|
||||||
export const DEFAULT_CONFIG_FILE_NAME = ".github/codeql-action.yaml";
|
export const DEFAULT_CONFIG_FILE_NAME = ".github/codeql-config.yml";
|
||||||
|
|
||||||
/** The default ref to use in configuration file shorthands. */
|
/** The default ref to use in configuration file shorthands. */
|
||||||
export const DEFAULT_CONFIG_FILE_REF = "main";
|
export const DEFAULT_CONFIG_FILE_REF = "main";
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bundleVersion": "codeql-bundle-v2.26.1",
|
"bundleVersion": "codeql-bundle-v2.26.2",
|
||||||
"cliVersion": "2.26.1",
|
"cliVersion": "2.26.2",
|
||||||
"priorBundleVersion": "codeql-bundle-v2.26.0",
|
"priorBundleVersion": "codeql-bundle-v2.26.1",
|
||||||
"priorCliVersion": "2.26.0"
|
"priorCliVersion": "2.26.1"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -88,7 +88,7 @@ export enum EnvVar {
|
|||||||
LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION",
|
LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION",
|
||||||
|
|
||||||
/** UUID representing the current job run. */
|
/** UUID representing the current job run. */
|
||||||
JOB_RUN_UUID = "JOB_RUN_UUID",
|
JOB_RUN_UUID = "CODEQL_ACTION_JOB_RUN_UUID",
|
||||||
|
|
||||||
/** Status for the entire job, submitted to the status report in `init-post` */
|
/** Status for the entire job, submitted to the status report in `init-post` */
|
||||||
JOB_STATUS = "CODEQL_ACTION_JOB_STATUS",
|
JOB_STATUS = "CODEQL_ACTION_JOB_STATUS",
|
||||||
@@ -270,6 +270,11 @@ export class ReadOnlyEnv<T extends string | undefined = string | undefined> {
|
|||||||
return Object.create(this, { vars: { value: { ...this.vars } } }) as this;
|
return Object.create(this, { vars: { value: { ...this.vars } } }) as this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Gets a copy of the underlying environment. */
|
||||||
|
public get(): Record<string, T> {
|
||||||
|
return { ...this.vars };
|
||||||
|
}
|
||||||
|
|
||||||
/** Tries to get the value for `name` and throws if there isn't one. */
|
/** Tries to get the value for `name` and throws if there isn't one. */
|
||||||
public getRequired(name: string): string {
|
public getRequired(name: string): string {
|
||||||
return getRequiredEnvVar(this.vars, name);
|
return getRequiredEnvVar(this.vars, name);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import * as path from "path";
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import * as io from "@actions/io";
|
import * as io from "@actions/io";
|
||||||
import * as semver from "semver";
|
import * as semver from "semver";
|
||||||
import { v4 as uuidV4 } from "uuid";
|
|
||||||
|
|
||||||
import { Action, ActionState, runInActions } from "./action-common";
|
import { Action, ActionState, runInActions } from "./action-common";
|
||||||
import {
|
import {
|
||||||
@@ -255,11 +254,6 @@ async function run(
|
|||||||
);
|
);
|
||||||
const repositoryProperties = repositoryPropertiesResult.orElse({});
|
const repositoryProperties = repositoryPropertiesResult.orElse({});
|
||||||
|
|
||||||
// Create a unique identifier for this run.
|
|
||||||
const jobRunUuid = uuidV4();
|
|
||||||
logger.info(`Job run UUID is ${jobRunUuid}.`);
|
|
||||||
core.exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid);
|
|
||||||
|
|
||||||
core.exportVariable(EnvVar.INIT_ACTION_HAS_RUN, "true");
|
core.exportVariable(EnvVar.INIT_ACTION_HAS_RUN, "true");
|
||||||
|
|
||||||
// path.resolve() respects the intended semantics of source-root. If
|
// path.resolve() respects the intended semantics of source-root. If
|
||||||
|
|||||||
+27
-5
@@ -35,6 +35,11 @@ export function isNumber(value: unknown): value is number {
|
|||||||
return typeof value === "number";
|
return typeof value === "number";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Asserts that `value` is a boolean. */
|
||||||
|
export function isBoolean(value: unknown): value is boolean {
|
||||||
|
return typeof value === "boolean";
|
||||||
|
}
|
||||||
|
|
||||||
/** Asserts that `value` is either a string or undefined. */
|
/** Asserts that `value` is either a string or undefined. */
|
||||||
export function isStringOrUndefined(
|
export function isStringOrUndefined(
|
||||||
value: unknown,
|
value: unknown,
|
||||||
@@ -62,14 +67,11 @@ function defaultCheck(
|
|||||||
return (arg) => ({ unknownKeys: [], invalidKeys: [], valid: validate(arg) });
|
return (arg) => ({ unknownKeys: [], invalidKeys: [], valid: validate(arg) });
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeValidator<T>(
|
function makeValidator<T>(validate: (arg: unknown) => arg is T) {
|
||||||
validate: (arg: unknown) => arg is T,
|
|
||||||
required: boolean = true,
|
|
||||||
) {
|
|
||||||
return {
|
return {
|
||||||
validate,
|
validate,
|
||||||
check: defaultCheck(validate),
|
check: defaultCheck(validate),
|
||||||
required,
|
required: true,
|
||||||
} as const satisfies Validator<T>;
|
} as const satisfies Validator<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,6 +84,9 @@ export const string = makeValidator(isString);
|
|||||||
/** A validator for number fields in schemas. */
|
/** A validator for number fields in schemas. */
|
||||||
export const number = makeValidator(isNumber);
|
export const number = makeValidator(isNumber);
|
||||||
|
|
||||||
|
/** A validator for boolean fields in schemas. */
|
||||||
|
export const boolean = makeValidator(isBoolean);
|
||||||
|
|
||||||
/** A validator for arrays. */
|
/** A validator for arrays. */
|
||||||
export function array<T>(validator: Validator<T>) {
|
export function array<T>(validator: Validator<T>) {
|
||||||
const validate = (val: unknown) => {
|
const validate = (val: unknown) => {
|
||||||
@@ -221,6 +226,23 @@ export function validateSchema<
|
|||||||
return result.valid;
|
return result.valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates that `arr` is an array whose elements satisfy at least `elementSchema`.
|
||||||
|
* Additional keys are accepted in each element.
|
||||||
|
*
|
||||||
|
* @param elementSchema The schema to validate the elements against.
|
||||||
|
* @param arr The array to validate.
|
||||||
|
* @returns Asserts that `arr` has elements of `schema`'s type if validation is successful.
|
||||||
|
*/
|
||||||
|
export function validateArray<
|
||||||
|
S extends Schema,
|
||||||
|
T extends UnvalidatedArray = Array<FromSchema<S>>,
|
||||||
|
>(elementSchema: S, arr: UnvalidatedArray): arr is T {
|
||||||
|
const elementValidator = object(elementSchema);
|
||||||
|
|
||||||
|
return array(elementValidator).validate(arr);
|
||||||
|
}
|
||||||
|
|
||||||
export interface CheckSchemaOptions {
|
export interface CheckSchemaOptions {
|
||||||
/** Whether to stop validation after the first error. */
|
/** Whether to stop validation after the first error. */
|
||||||
failFast?: boolean;
|
failFast?: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { v4 as uuidV4 } from "uuid";
|
|
||||||
|
|
||||||
import { Action, ActionState, runInActions } from "./action-common";
|
import { Action, ActionState, runInActions } from "./action-common";
|
||||||
import {
|
import {
|
||||||
@@ -95,7 +94,7 @@ async function sendCompletedStatusReport(
|
|||||||
|
|
||||||
/** The main behaviour of this action. */
|
/** The main behaviour of this action. */
|
||||||
async function run(
|
async function run(
|
||||||
actionState: ActionState<["Base", "Logger", "Actions"]>,
|
actionState: ActionState<["Base", "Logger", "Env", "Actions"]>,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
// To capture errors appropriately, keep as much code within the try-catch as
|
// To capture errors appropriately, keep as much code within the try-catch as
|
||||||
// possible, and only use safe functions outside.
|
// possible, and only use safe functions outside.
|
||||||
@@ -140,10 +139,6 @@ async function run(
|
|||||||
|
|
||||||
const actionStateWithFeatures = { ...actionState, features };
|
const actionStateWithFeatures = { ...actionState, features };
|
||||||
|
|
||||||
const jobRunUuid = uuidV4();
|
|
||||||
logger.info(`Job run UUID is ${jobRunUuid}.`);
|
|
||||||
core.exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid);
|
|
||||||
|
|
||||||
const statusReportBase = await createStatusReportBase(
|
const statusReportBase = await createStatusReportBase(
|
||||||
ActionName.SetupCodeQL,
|
ActionName.SetupCodeQL,
|
||||||
"starting",
|
"starting",
|
||||||
|
|||||||
+14
-19
@@ -3,11 +3,12 @@ import * as path from "path";
|
|||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
|
import { Action, ActionState, runInActions } from "./action-common";
|
||||||
import * as actionsUtil from "./actions-util";
|
import * as actionsUtil from "./actions-util";
|
||||||
import { getGitHubVersion } from "./api-client";
|
import { getGitHubVersion } from "./api-client";
|
||||||
import { FeatureEnablement, initFeatures } from "./feature-flags";
|
import { FeatureEnablement, initFeatures } from "./feature-flags";
|
||||||
import { BuiltInLanguage, parseBuiltInLanguage } from "./languages";
|
import { BuiltInLanguage, parseBuiltInLanguage } from "./languages";
|
||||||
import { getActionsLogger, Logger } from "./logging";
|
import { Logger } from "./logging";
|
||||||
import { getRepositoryNwo } from "./repository";
|
import { getRepositoryNwo } from "./repository";
|
||||||
import {
|
import {
|
||||||
credentialToStr,
|
credentialToStr,
|
||||||
@@ -23,14 +24,14 @@ import {
|
|||||||
import { generateCertificateAuthority } from "./start-proxy/ca";
|
import { generateCertificateAuthority } from "./start-proxy/ca";
|
||||||
import { checkProxyEnvironment } from "./start-proxy/environment";
|
import { checkProxyEnvironment } from "./start-proxy/environment";
|
||||||
import { checkConnections } from "./start-proxy/reachability";
|
import { checkConnections } from "./start-proxy/reachability";
|
||||||
import { ActionName, sendUnhandledErrorStatusReport } from "./status-report";
|
import { ActionName } from "./status-report";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
|
|
||||||
async function run(startedAt: Date) {
|
async function run(action: ActionState<["Base", "Logger", "Env", "Actions"]>) {
|
||||||
// To capture errors appropriately, keep as much code within the try-catch as
|
// To capture errors appropriately, keep as much code within the try-catch as
|
||||||
// possible, and only use safe functions outside.
|
// possible, and only use safe functions outside.
|
||||||
|
const startedAt = action.startedAt;
|
||||||
const logger = getActionsLogger();
|
const logger = action.logger;
|
||||||
let features: FeatureEnablement | undefined;
|
let features: FeatureEnablement | undefined;
|
||||||
let language: BuiltInLanguage | undefined;
|
let language: BuiltInLanguage | undefined;
|
||||||
|
|
||||||
@@ -122,21 +123,15 @@ async function run(startedAt: Date) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function runWrapper() {
|
/** Defines the `start-proxy` Action. */
|
||||||
const startedAt = new Date();
|
const startProxyAction: Action = {
|
||||||
const logger = getActionsLogger();
|
name: ActionName.StartProxy,
|
||||||
|
run,
|
||||||
|
transformTelemetryError: getSafeErrorMessage,
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
export async function runWrapper() {
|
||||||
await run(startedAt);
|
await runInActions(startProxyAction);
|
||||||
} catch (error) {
|
|
||||||
core.setFailed(`start-proxy action failed: ${util.getErrorMessage(error)}`);
|
|
||||||
await sendUnhandledErrorStatusReport(
|
|
||||||
ActionName.StartProxy,
|
|
||||||
startedAt,
|
|
||||||
getSafeErrorMessage(util.wrapError(error)),
|
|
||||||
logger,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function startProxy(
|
async function startProxy(
|
||||||
|
|||||||
+1
-7
@@ -83,12 +83,6 @@ export class StartProxyError extends Error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface StartProxyStatus extends StatusReportBase {
|
|
||||||
// A comma-separated list of registry types which are configured for CodeQL.
|
|
||||||
// This only includes registry types we support, not all that are configured.
|
|
||||||
registry_types: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a status report for the `start-proxy` action indicating a successful outcome.
|
* Sends a status report for the `start-proxy` action indicating a successful outcome.
|
||||||
*
|
*
|
||||||
@@ -112,7 +106,7 @@ export async function sendSuccessStatusReport(
|
|||||||
logger,
|
logger,
|
||||||
);
|
);
|
||||||
if (statusReportBase !== undefined) {
|
if (statusReportBase !== undefined) {
|
||||||
const statusReport: StartProxyStatus = {
|
const statusReport: StatusReportBase = {
|
||||||
...statusReportBase,
|
...statusReportBase,
|
||||||
registry_types: registry_types.join(","),
|
registry_types: registry_types.join(","),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -254,13 +254,19 @@ export function credentialToStr(credential: Credential): string {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A package registry is identified by its type and address. */
|
/** The schema for `RegistryBase` objects. */
|
||||||
export type Registry = {
|
export const registryBaseSchema = {
|
||||||
/** The type of the package registry. */
|
/** The type of the package registry. */
|
||||||
type: string;
|
type: json.string,
|
||||||
/** Whether the registry replaces the base registry for the ecosystem. */
|
/** Whether the registry replaces the base registry for the ecosystem. */
|
||||||
"replaces-base"?: boolean;
|
"replaces-base": json.optional(json.boolean),
|
||||||
} & Address;
|
} as const satisfies json.Schema;
|
||||||
|
|
||||||
|
/** Information about a registry, other than its address. */
|
||||||
|
export type RegistryBase = json.FromSchema<typeof registryBaseSchema>;
|
||||||
|
|
||||||
|
/** A package registry is identified by its type and address. */
|
||||||
|
export type Registry = RegistryBase & Address;
|
||||||
|
|
||||||
// If a registry has an `url`, then that takes precedence over the `host` which may or may
|
// If a registry has an `url`, then that takes precedence over the `host` which may or may
|
||||||
// not be defined.
|
// not be defined.
|
||||||
|
|||||||
+104
-1
@@ -1,17 +1,21 @@
|
|||||||
import test from "ava";
|
import test from "ava";
|
||||||
import * as sinon from "sinon";
|
import * as sinon from "sinon";
|
||||||
|
import * as uuid from "uuid";
|
||||||
|
|
||||||
import * as actionsUtil from "./actions-util";
|
import * as actionsUtil from "./actions-util";
|
||||||
import { Config } from "./config-utils";
|
import { Config } from "./config-utils";
|
||||||
import { EnvVar } from "./environment";
|
import { EnvVar, RegistryProxyVars } from "./environment";
|
||||||
import { BuiltInLanguage } from "./languages";
|
import { BuiltInLanguage } from "./languages";
|
||||||
import { getRunnerLogger } from "./logging";
|
import { getRunnerLogger } from "./logging";
|
||||||
import { ToolsSource } from "./setup-codeql";
|
import { ToolsSource } from "./setup-codeql";
|
||||||
|
import type { Registry } from "./start-proxy";
|
||||||
import {
|
import {
|
||||||
ActionName,
|
ActionName,
|
||||||
createInitWithConfigStatusReport,
|
createInitWithConfigStatusReport,
|
||||||
createStatusReportBase,
|
createStatusReportBase,
|
||||||
getActionsStatus,
|
getActionsStatus,
|
||||||
|
getRegistryTypesFromEnv,
|
||||||
|
getJobUUID,
|
||||||
InitStatusReport,
|
InitStatusReport,
|
||||||
InitWithConfigStatusReport,
|
InitWithConfigStatusReport,
|
||||||
} from "./status-report";
|
} from "./status-report";
|
||||||
@@ -20,11 +24,106 @@ import {
|
|||||||
setupActionsVars,
|
setupActionsVars,
|
||||||
createTestConfig,
|
createTestConfig,
|
||||||
makeMacro,
|
makeMacro,
|
||||||
|
getTestEnv,
|
||||||
|
RecordingLogger,
|
||||||
|
callee,
|
||||||
} from "./testing-utils";
|
} from "./testing-utils";
|
||||||
import { BuildMode, ConfigurationError, withTmpDir, wrapError } from "./util";
|
import { BuildMode, ConfigurationError, withTmpDir, wrapError } from "./util";
|
||||||
|
|
||||||
setupTests(test);
|
setupTests(test);
|
||||||
|
|
||||||
|
test("getRegistryTypesFromEnv - gets unique registry types from environment", async (t) => {
|
||||||
|
const logger = new RecordingLogger(true);
|
||||||
|
const env = getTestEnv({
|
||||||
|
[RegistryProxyVars.PROXY_URLS]: JSON.stringify([
|
||||||
|
{ type: "git_source", url: "https://example.com" },
|
||||||
|
{ type: "git_source", url: "https://github.com" },
|
||||||
|
{ type: "docker_registry", url: "https://registry.example.com" },
|
||||||
|
] satisfies Array<Partial<Registry>>),
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = getRegistryTypesFromEnv(logger, env);
|
||||||
|
t.deepEqual(result, ["git_source", "docker_registry"].sort().join(","));
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getRegistryTypesFromEnv - returns undefined if the env var is not set", async (t) => {
|
||||||
|
const logger = new RecordingLogger(true);
|
||||||
|
const env = getTestEnv({});
|
||||||
|
|
||||||
|
const result = getRegistryTypesFromEnv(logger, env);
|
||||||
|
t.is(result, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getRegistryTypesFromEnv - returns undefined if the env var is not valid JSON", async (t) => {
|
||||||
|
const logger = new RecordingLogger(true);
|
||||||
|
const env = getTestEnv({ [RegistryProxyVars.PROXY_URLS]: "[" });
|
||||||
|
|
||||||
|
const result = getRegistryTypesFromEnv(logger, env);
|
||||||
|
t.is(result, undefined);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getRegistryTypesFromEnv - returns undefined if the env var is unexpected JSON", async (t) => {
|
||||||
|
const logger = new RecordingLogger(true);
|
||||||
|
|
||||||
|
t.is(
|
||||||
|
getRegistryTypesFromEnv(
|
||||||
|
logger,
|
||||||
|
getTestEnv({
|
||||||
|
// Top-level object rather than an array of objects.
|
||||||
|
[RegistryProxyVars.PROXY_URLS]: JSON.stringify({ type: "git_source" }),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
undefined,
|
||||||
|
);
|
||||||
|
t.is(
|
||||||
|
getRegistryTypesFromEnv(
|
||||||
|
logger,
|
||||||
|
getTestEnv({
|
||||||
|
// Object has no "type" key.
|
||||||
|
[RegistryProxyVars.PROXY_URLS]: JSON.stringify([{}]),
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
undefined,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getJobUUID - generates valid UUIDs", async (t) => {
|
||||||
|
await callee(getJobUUID)
|
||||||
|
.withArgs()
|
||||||
|
.logs(t, "Job run UUID is ")
|
||||||
|
.hasEnv(t, (val) => {
|
||||||
|
return {
|
||||||
|
[EnvVar.JOB_RUN_UUID]: val,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.passes((val) => {
|
||||||
|
t.true(uuid.validate(val));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getJobUUID - retrieves existing job UUIDs", async (t) => {
|
||||||
|
const existingJobUuid = uuid.v4();
|
||||||
|
await callee(getJobUUID)
|
||||||
|
.withArgs()
|
||||||
|
.withEnv((env) => {
|
||||||
|
env.set(EnvVar.JOB_RUN_UUID, existingJobUuid);
|
||||||
|
})
|
||||||
|
.logs(t, `Existing job run UUID is ${existingJobUuid}.`)
|
||||||
|
.passes(t.deepEqual, existingJobUuid);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("getJobUUID - doesn't retrieve invalid UUIDs", async (t) => {
|
||||||
|
const existingJobUuid = "not-a-uuid";
|
||||||
|
await callee(getJobUUID)
|
||||||
|
.withArgs()
|
||||||
|
.withEnv((env) => {
|
||||||
|
env.set(EnvVar.JOB_RUN_UUID, existingJobUuid);
|
||||||
|
})
|
||||||
|
.logs(t, `Job run UUID is `)
|
||||||
|
.notLogs(t, `Existing job run UUID is ${existingJobUuid}.`)
|
||||||
|
.passes(t.notDeepEqual, existingJobUuid);
|
||||||
|
});
|
||||||
|
|
||||||
function setupEnvironmentAndStub(tmpDir: string) {
|
function setupEnvironmentAndStub(tmpDir: string) {
|
||||||
setupActionsVars(tmpDir, tmpDir, {
|
setupActionsVars(tmpDir, tmpDir, {
|
||||||
GITHUB_EVENT_NAME: "dynamic",
|
GITHUB_EVENT_NAME: "dynamic",
|
||||||
@@ -34,6 +133,9 @@ function setupEnvironmentAndStub(tmpDir: string) {
|
|||||||
|
|
||||||
process.env[EnvVar.ANALYSIS_KEY] = "analysis-key";
|
process.env[EnvVar.ANALYSIS_KEY] = "analysis-key";
|
||||||
process.env["ImageVersion"] = "2023.05.19.1";
|
process.env["ImageVersion"] = "2023.05.19.1";
|
||||||
|
process.env[RegistryProxyVars.PROXY_URLS] = JSON.stringify([
|
||||||
|
{ type: "maven_repository" },
|
||||||
|
] satisfies Array<Partial<Registry>>);
|
||||||
|
|
||||||
const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
|
const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
|
||||||
getRequiredInput.withArgs("matrix").resolves("input/matrix");
|
getRequiredInput.withArgs("matrix").resolves("input/matrix");
|
||||||
@@ -77,6 +179,7 @@ test.serial("createStatusReportBase", async (t) => {
|
|||||||
t.is(typeof statusReport.job_run_uuid, "string");
|
t.is(typeof statusReport.job_run_uuid, "string");
|
||||||
t.is(statusReport.languages, "java,swift");
|
t.is(statusReport.languages, "java,swift");
|
||||||
t.is(statusReport.ref, process.env["GITHUB_REF"]!);
|
t.is(statusReport.ref, process.env["GITHUB_REF"]!);
|
||||||
|
t.is(statusReport.registry_types, "maven_repository");
|
||||||
t.is(statusReport.runner_available_disk_space_bytes, 100);
|
t.is(statusReport.runner_available_disk_space_bytes, 100);
|
||||||
t.is(statusReport.runner_image_version, process.env["ImageVersion"]);
|
t.is(statusReport.runner_image_version, process.env["ImageVersion"]);
|
||||||
t.is(statusReport.runner_os, process.env["RUNNER_OS"]!);
|
t.is(statusReport.runner_os, process.env["RUNNER_OS"]!);
|
||||||
|
|||||||
+80
-1
@@ -1,7 +1,9 @@
|
|||||||
import * as os from "os";
|
import * as os from "os";
|
||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
import * as uuid from "uuid";
|
||||||
|
|
||||||
|
import type { ActionState } from "./action-common";
|
||||||
import {
|
import {
|
||||||
getWorkflowEventName,
|
getWorkflowEventName,
|
||||||
getOptionalInput,
|
getOptionalInput,
|
||||||
@@ -17,12 +19,14 @@ import type { ComputedInput, InputName } from "./config/inputs";
|
|||||||
import { parseRegistriesWithoutCredentials } from "./config/pack-registries";
|
import { parseRegistriesWithoutCredentials } from "./config/pack-registries";
|
||||||
import type { DependencyCacheRestoreStatusReport } from "./dependency-caching";
|
import type { DependencyCacheRestoreStatusReport } from "./dependency-caching";
|
||||||
import { DocUrl } from "./doc-url";
|
import { DocUrl } from "./doc-url";
|
||||||
import { EnvVar } from "./environment";
|
import { EnvVar, getEnv, ReadOnlyEnv, RegistryProxyVars } from "./environment";
|
||||||
import { getRef } from "./git-utils";
|
import { getRef } from "./git-utils";
|
||||||
|
import * as json from "./json";
|
||||||
import type { Logger } from "./logging";
|
import type { Logger } from "./logging";
|
||||||
import type { OverlayBaseDatabaseDownloadStats } from "./overlay/caching";
|
import type { OverlayBaseDatabaseDownloadStats } from "./overlay/caching";
|
||||||
import { getRepositoryNwo } from "./repository";
|
import { getRepositoryNwo } from "./repository";
|
||||||
import type { ToolsSource } from "./setup-codeql";
|
import type { ToolsSource } from "./setup-codeql";
|
||||||
|
import { registryBaseSchema } from "./start-proxy/types";
|
||||||
import {
|
import {
|
||||||
ConfigurationError,
|
ConfigurationError,
|
||||||
getRequiredEnvParam,
|
getRequiredEnvParam,
|
||||||
@@ -59,6 +63,30 @@ export function getDisplayActionName(actionName: ActionName): string {
|
|||||||
return actionName;
|
return actionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Either creates a UUIDv4 for the analysis or retrieves an existing one from the
|
||||||
|
* environment and returns it.
|
||||||
|
* If a new UUID is generated, it is also exported as an environment variable.
|
||||||
|
*/
|
||||||
|
export function getJobUUID(
|
||||||
|
action: ActionState<["Logger", "ReadOnlyEnv", "Actions"]>,
|
||||||
|
) {
|
||||||
|
// Check if we already have a UUID for the analysis and return it if so.
|
||||||
|
const existingJobRunUuid = action.env.getOptional(EnvVar.JOB_RUN_UUID);
|
||||||
|
|
||||||
|
if (existingJobRunUuid !== undefined && uuid.validate(existingJobRunUuid)) {
|
||||||
|
action.logger.info(`Existing job run UUID is ${existingJobRunUuid}.`);
|
||||||
|
return existingJobRunUuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise generate a new UUID.
|
||||||
|
const jobRunUuid = uuid.v4();
|
||||||
|
action.logger.info(`Job run UUID is ${jobRunUuid}.`);
|
||||||
|
|
||||||
|
action.actions.exportVariable(EnvVar.JOB_RUN_UUID, jobRunUuid);
|
||||||
|
return jobRunUuid;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns a boolean indicating whether the analysis is considered to be first party.
|
* @returns a boolean indicating whether the analysis is considered to be first party.
|
||||||
*
|
*
|
||||||
@@ -159,6 +187,12 @@ export interface StatusReportBase {
|
|||||||
ml_powered_javascript_queries?: string;
|
ml_powered_javascript_queries?: string;
|
||||||
/** Ref that the workflow was triggered on. */
|
/** Ref that the workflow was triggered on. */
|
||||||
ref: string;
|
ref: string;
|
||||||
|
/**
|
||||||
|
* A comma-separated list of private registry types which are configured for CodeQL.
|
||||||
|
* This only includes registry types we support (as determined by the `start-proxy` action),
|
||||||
|
* not all that are configured.
|
||||||
|
*/
|
||||||
|
registry_types?: string;
|
||||||
/** Action runner hardware architecture (context runner.arch). */
|
/** Action runner hardware architecture (context runner.arch). */
|
||||||
runner_arch?: string;
|
runner_arch?: string;
|
||||||
/** Available disk space on the runner, in bytes. */
|
/** Available disk space on the runner, in bytes. */
|
||||||
@@ -262,6 +296,50 @@ export interface EventReport {
|
|||||||
started_at: string;
|
started_at: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to retrieve a list of private registry types from the `CODEQL_PROXY_URLS` environment
|
||||||
|
* variable and returns it as a comma-separated string if successful. Returns `undefined` otherwise.
|
||||||
|
*/
|
||||||
|
export function getRegistryTypesFromEnv(
|
||||||
|
logger: Logger,
|
||||||
|
env: ReadOnlyEnv = getEnv(),
|
||||||
|
): string | undefined {
|
||||||
|
// Try to get the value of the environment variable.
|
||||||
|
const value = env.getOptional(RegistryProxyVars.PROXY_URLS);
|
||||||
|
|
||||||
|
if (value === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to parse the JSON we expect to find in it and return the comma-separated list of
|
||||||
|
// (unique) registry types.
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(value) as unknown;
|
||||||
|
|
||||||
|
// Check that the parsed JSON meets our expectations.
|
||||||
|
if (!json.isArray(data)) {
|
||||||
|
logger.debug(
|
||||||
|
`Expected '${RegistryProxyVars.PROXY_URLS}' to contain a JSON array, but got '${typeof data}'.`,
|
||||||
|
);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
if (!json.validateArray(registryBaseSchema, data)) {
|
||||||
|
logger.debug(
|
||||||
|
`Expected '${RegistryProxyVars.PROXY_URLS}' to contain a JSON array of registry objects, but got something else.`,
|
||||||
|
);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const types = new Set(data.map((r) => r.type));
|
||||||
|
return Array.from(types).sort().join(",");
|
||||||
|
} catch (err) {
|
||||||
|
logger.debug(
|
||||||
|
`Failed to parse '${RegistryProxyVars.PROXY_URLS}': ${getErrorMessage(err)}.`,
|
||||||
|
);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compose a StatusReport.
|
* Compose a StatusReport.
|
||||||
*
|
*
|
||||||
@@ -324,6 +402,7 @@ export async function createStatusReportBase(
|
|||||||
job_name: jobName,
|
job_name: jobName,
|
||||||
job_run_uuid: jobRunUUID,
|
job_run_uuid: jobRunUUID,
|
||||||
ref,
|
ref,
|
||||||
|
registry_types: getRegistryTypesFromEnv(logger),
|
||||||
runner_os: runnerOs,
|
runner_os: runnerOs,
|
||||||
started_at: workflowStartedAt,
|
started_at: workflowStartedAt,
|
||||||
status,
|
status,
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import * as path from "path";
|
||||||
|
import * as stream from "stream";
|
||||||
|
|
||||||
|
import test from "ava";
|
||||||
|
|
||||||
|
import { getRunnerLogger } from "./logging";
|
||||||
|
import { extractTarZst } from "./tar";
|
||||||
|
import { setupTests } from "./testing-utils";
|
||||||
|
import { withTmpDir } from "./util";
|
||||||
|
|
||||||
|
setupTests(test);
|
||||||
|
|
||||||
|
test("extractTarZst rejects if the input stream errors", async (t) => {
|
||||||
|
await withTmpDir(async (tmpDir) => {
|
||||||
|
const archive = new stream.PassThrough();
|
||||||
|
const promise = extractTarZst(
|
||||||
|
archive,
|
||||||
|
path.join(tmpDir, "dest"),
|
||||||
|
{ type: "gnu", version: "1.34" },
|
||||||
|
getRunnerLogger(true),
|
||||||
|
);
|
||||||
|
|
||||||
|
archive.destroy(
|
||||||
|
Object.assign(new Error("socket hang up"), {
|
||||||
|
code: "ECONNRESET",
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
await t.throwsAsync(promise, {
|
||||||
|
message: /Error while downloading and extracting tar/,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
+9
-4
@@ -194,10 +194,15 @@ export async function extractTarZst(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (tar instanceof stream.Readable) {
|
if (tar instanceof stream.Readable) {
|
||||||
tar.pipe(tarProcess.stdin).on("error", (err) => {
|
// Use `pipeline` rather than `pipe` so that an error on either stream is reported here
|
||||||
reject(
|
// rather than being emitted as an unhandled `error` event, and so that `tar`'s standard
|
||||||
new Error(`Error while downloading and extracting tar: ${err}`),
|
// input is closed if the download fails partway through.
|
||||||
);
|
stream.pipeline(tar, tarProcess.stdin, (err) => {
|
||||||
|
if (err) {
|
||||||
|
reject(
|
||||||
|
new Error(`Error while downloading and extracting tar: ${err}`),
|
||||||
|
);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+83
-25
@@ -34,11 +34,14 @@ import { ActionName } from "./status-report";
|
|||||||
import {
|
import {
|
||||||
DEFAULT_DEBUG_ARTIFACT_NAME,
|
DEFAULT_DEBUG_ARTIFACT_NAME,
|
||||||
DEFAULT_DEBUG_DATABASE_NAME,
|
DEFAULT_DEBUG_DATABASE_NAME,
|
||||||
|
Failure,
|
||||||
getEnv,
|
getEnv,
|
||||||
GitHubVariant,
|
GitHubVariant,
|
||||||
GitHubVersion,
|
GitHubVersion,
|
||||||
HTTPError,
|
HTTPError,
|
||||||
resetCachedCodeQlVersion,
|
resetCachedCodeQlVersion,
|
||||||
|
Result,
|
||||||
|
Success,
|
||||||
} from "./util";
|
} from "./util";
|
||||||
|
|
||||||
export const SAMPLE_DOTCOM_API_DETAILS = {
|
export const SAMPLE_DOTCOM_API_DETAILS = {
|
||||||
@@ -182,13 +185,32 @@ export function getTestEnv(testEnv: NodeJS.ProcessEnv = {}): Env {
|
|||||||
return getEnv(testEnv);
|
return getEnv(testEnv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** An implementation of `ActionsEnv` for use in tests. */
|
||||||
|
class TestActionsEnv implements ActionsEnv {
|
||||||
|
constructor(private readonly env: Env) {}
|
||||||
|
|
||||||
|
public clone(env: Env): this {
|
||||||
|
return Object.create(this, { env: { value: env } }) as this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public getRequiredInput(name: string): string {
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getOptionalInput(_name: string): string | undefined {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
public exportVariable(name: string, value: string): void {
|
||||||
|
this.env.set(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an `ActionsEnv` instance for use in tests.
|
* Gets an `ActionsEnv` instance for use in tests.
|
||||||
*/
|
*/
|
||||||
export function getTestActionsEnv(): ActionsEnv {
|
export function getTestActionsEnv(env: Env): TestActionsEnv {
|
||||||
return {
|
return new TestActionsEnv(env);
|
||||||
getOptionalInput: () => undefined,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** For testing purposes, we make all available state features accessible in `TestEnv`. */
|
/** For testing purposes, we make all available state features accessible in `TestEnv`. */
|
||||||
@@ -206,12 +228,13 @@ type AllState = [
|
|||||||
export function initAllState(
|
export function initAllState(
|
||||||
overrides?: Partial<ActionState<AllState>>,
|
overrides?: Partial<ActionState<AllState>>,
|
||||||
): ActionState<AllState> {
|
): ActionState<AllState> {
|
||||||
|
const env = getTestEnv();
|
||||||
return {
|
return {
|
||||||
name: ActionName.Init,
|
name: ActionName.Init,
|
||||||
startedAt: new Date(),
|
startedAt: new Date(),
|
||||||
logger: new RecordingLogger(),
|
logger: new RecordingLogger(),
|
||||||
env: getTestEnv(),
|
env,
|
||||||
actions: getTestActionsEnv(),
|
actions: getTestActionsEnv(env),
|
||||||
apiClient: github.getOctokit("123"),
|
apiClient: github.getOctokit("123"),
|
||||||
features: createFeatures([]),
|
features: createFeatures([]),
|
||||||
...overrides,
|
...overrides,
|
||||||
@@ -222,9 +245,13 @@ type DelayedCheck<
|
|||||||
Args extends readonly any[],
|
Args extends readonly any[],
|
||||||
R,
|
R,
|
||||||
Fs extends ReadonlyArray<AllState[number]>,
|
Fs extends ReadonlyArray<AllState[number]>,
|
||||||
> = (env: Readonly<BaseEnvBuilder<Args, R, Fs>>) => Promise<any>;
|
> = (
|
||||||
|
env: Readonly<BaseEnvBuilder<Args, R, Fs>>,
|
||||||
|
result: Result<Awaited<R>, ThrownError<ErrorConstructor | Error>>,
|
||||||
|
) => Promise<any>;
|
||||||
|
|
||||||
export type ValueOrMutation<T> = T | ((val: T) => void);
|
export type Mutation<T> = (val: T) => void;
|
||||||
|
export type ValueOrMutation<T> = T | Mutation<T>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps a function that accepts an `ActionState` for testing in different environments.
|
* Wraps a function that accepts an `ActionState` for testing in different environments.
|
||||||
@@ -236,6 +263,7 @@ abstract class BaseEnvBuilder<
|
|||||||
> {
|
> {
|
||||||
protected readonly fn: (state: ActionState<Fs>, ...args: Args) => R;
|
protected readonly fn: (state: ActionState<Fs>, ...args: Args) => R;
|
||||||
private logger: RecordingLogger;
|
private logger: RecordingLogger;
|
||||||
|
private actions: TestActionsEnv;
|
||||||
protected state: ActionState<AllState>;
|
protected state: ActionState<AllState>;
|
||||||
protected checks: Array<DelayedCheck<Args, R, Fs>>;
|
protected checks: Array<DelayedCheck<Args, R, Fs>>;
|
||||||
|
|
||||||
@@ -245,15 +273,26 @@ abstract class BaseEnvBuilder<
|
|||||||
) {
|
) {
|
||||||
this.fn = fn;
|
this.fn = fn;
|
||||||
this.logger = new RecordingLogger();
|
this.logger = new RecordingLogger();
|
||||||
this.state =
|
|
||||||
cloneFrom !== undefined
|
if (cloneFrom !== undefined) {
|
||||||
? ({
|
const env = cloneFrom.state.env.clone();
|
||||||
...cloneFrom.state,
|
this.actions = cloneFrom.actions.clone(env);
|
||||||
env: cloneFrom.state.env.clone(),
|
this.state = {
|
||||||
actions: Object.create(cloneFrom.state.actions),
|
...cloneFrom.state,
|
||||||
logger: this.logger,
|
env,
|
||||||
} satisfies ActionState<AllState>)
|
actions: this.actions,
|
||||||
: initAllState({ logger: this.logger });
|
logger: this.logger,
|
||||||
|
} satisfies ActionState<AllState>;
|
||||||
|
} else {
|
||||||
|
const env = getTestEnv();
|
||||||
|
this.actions = getTestActionsEnv(env);
|
||||||
|
this.state = initAllState({
|
||||||
|
logger: this.logger,
|
||||||
|
env,
|
||||||
|
actions: this.actions,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.checks = [...(cloneFrom?.checks ?? [])];
|
this.checks = [...(cloneFrom?.checks ?? [])];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,13 +359,10 @@ abstract class BaseEnvBuilder<
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public withActions(arg: ValueOrMutation<ActionsEnv>): this {
|
/** Applies `fn` to the `ActionsEnv`. */
|
||||||
|
public withActions(fn: Mutation<ActionsEnv>): this {
|
||||||
const result = this.clone();
|
const result = this.clone();
|
||||||
if (typeof arg === "function") {
|
fn(result.state.actions);
|
||||||
arg(result.state.actions);
|
|
||||||
} else {
|
|
||||||
result.state.actions = arg;
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,6 +378,28 @@ abstract class BaseEnvBuilder<
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a delayed check that the environment variables returned by `fn`
|
||||||
|
* are present in the environment after the main assertion passes.
|
||||||
|
*/
|
||||||
|
public hasEnv(
|
||||||
|
t: ExecutionContext<unknown>,
|
||||||
|
fn: (
|
||||||
|
value: Awaited<R> | undefined,
|
||||||
|
error: ThrownError<ErrorConstructor | Error> | undefined,
|
||||||
|
) => Record<string, string | undefined>,
|
||||||
|
): this {
|
||||||
|
const result = this.clone();
|
||||||
|
result.checks.push(async (env, r) => {
|
||||||
|
const value = r.orElse(undefined);
|
||||||
|
const error = r.isFailure() ? r.value : undefined;
|
||||||
|
const expected = fn(value, error);
|
||||||
|
|
||||||
|
t.like(env.getState().env.get(), expected);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a delayed check that `messages` are not logged. The check will be
|
* Adds a delayed check that `messages` are not logged. The check will be
|
||||||
* performed after the main assertion passes.
|
* performed after the main assertion passes.
|
||||||
@@ -439,7 +497,7 @@ class CallableEnvBuilder<
|
|||||||
|
|
||||||
// Run other delayed checks.
|
// Run other delayed checks.
|
||||||
for (const delayedCheck of this.checks) {
|
for (const delayedCheck of this.checks) {
|
||||||
await delayedCheck(this);
|
await delayedCheck(this, new Success(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the results of the function call and the main assertion.
|
// Return the results of the function call and the main assertion.
|
||||||
@@ -465,7 +523,7 @@ class CallableEnvBuilder<
|
|||||||
|
|
||||||
// Run other delayed checks.
|
// Run other delayed checks.
|
||||||
for (const delayedCheck of this.checks) {
|
for (const delayedCheck of this.checks) {
|
||||||
await delayedCheck(this);
|
await delayedCheck(this, new Failure(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the error.
|
// Return the error.
|
||||||
|
|||||||
@@ -38,6 +38,43 @@ test.serial(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
test.serial(
|
||||||
|
"downloadAndExtract falls back to downloading before extracting if streaming fails",
|
||||||
|
async (t) => {
|
||||||
|
await withTmpDir(async (tmpDir) => {
|
||||||
|
sinon.stub(process, "platform").value("linux");
|
||||||
|
const archivePath = path.join(tmpDir, "codeql-bundle.tar.zst");
|
||||||
|
const destination = path.join(tmpDir, "codeql");
|
||||||
|
const downloadTool = sinon
|
||||||
|
.stub(toolcache, "downloadTool")
|
||||||
|
.resolves(archivePath);
|
||||||
|
const extract = sinon.stub(tar, "extract").resolves(destination);
|
||||||
|
const extractTarZst = sinon.stub(tar, "extractTarZst").resolves();
|
||||||
|
const request = nock("https://example.com")
|
||||||
|
.get("/codeql-bundle.tar.zst")
|
||||||
|
.replyWithError(
|
||||||
|
Object.assign(new Error("socket hang up"), { code: "ECONNRESET" }),
|
||||||
|
);
|
||||||
|
|
||||||
|
const statusReport = await downloadAndExtract(
|
||||||
|
"https://example.com/codeql-bundle.tar.zst",
|
||||||
|
"zstd",
|
||||||
|
destination,
|
||||||
|
undefined,
|
||||||
|
{},
|
||||||
|
{ type: "gnu", version: "1.34" },
|
||||||
|
getRunnerLogger(true),
|
||||||
|
);
|
||||||
|
|
||||||
|
t.assert(Number.isInteger(statusReport.downloadDurationMs));
|
||||||
|
t.true(request.isDone());
|
||||||
|
t.false(extractTarZst.called);
|
||||||
|
t.true(downloadTool.calledOnce);
|
||||||
|
t.true(extract.calledOnce);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test.serial(
|
test.serial(
|
||||||
"downloadAndExtract omits the download duration when streaming extraction",
|
"downloadAndExtract omits the download duration when streaming extraction",
|
||||||
async (t) => {
|
async (t) => {
|
||||||
|
|||||||
+24
-4
@@ -19,6 +19,12 @@ import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util";
|
|||||||
*/
|
*/
|
||||||
const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB
|
const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How long the streaming download of the CodeQL tools may stall for before we abort it. This
|
||||||
|
* applies both to establishing the connection and to gaps between chunks of the response body.
|
||||||
|
*/
|
||||||
|
const STREAMING_STALL_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the tool cache directory for the CodeQL tools.
|
* The name of the tool cache directory for the CodeQL tools.
|
||||||
*/
|
*/
|
||||||
@@ -137,8 +143,8 @@ async function downloadAndExtractZstdWithStreaming(
|
|||||||
authorization ? { authorization } : {},
|
authorization ? { authorization } : {},
|
||||||
headers,
|
headers,
|
||||||
);
|
);
|
||||||
const response = await new Promise<IncomingMessage>((resolve) =>
|
const response = await new Promise<IncomingMessage>((resolve, reject) => {
|
||||||
https.get(
|
const request = https.get(
|
||||||
codeqlURL,
|
codeqlURL,
|
||||||
{
|
{
|
||||||
headers,
|
headers,
|
||||||
@@ -148,10 +154,24 @@ async function downloadAndExtractZstdWithStreaming(
|
|||||||
agent,
|
agent,
|
||||||
} as unknown as RequestOptions,
|
} as unknown as RequestOptions,
|
||||||
(r) => resolve(r),
|
(r) => resolve(r),
|
||||||
),
|
);
|
||||||
);
|
// Without this listener, connection failures such as `ECONNRESET` are emitted as unhandled
|
||||||
|
// `error` events, which terminate the process instead of letting us fall back to downloading
|
||||||
|
// the bundle before extracting it. This listener stays attached after the response arrives, so
|
||||||
|
// it also handles errors that occur while the response is being streamed.
|
||||||
|
request.on("error", reject);
|
||||||
|
request.setTimeout(STREAMING_STALL_TIMEOUT_MS, () => {
|
||||||
|
request.destroy(
|
||||||
|
new Error(
|
||||||
|
`No data received for ${formatDuration(STREAMING_STALL_TIMEOUT_MS)}.`,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (response.statusCode !== 200) {
|
if (response.statusCode !== 200) {
|
||||||
|
// Discard the response body so that the connection can be released.
|
||||||
|
response.resume();
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.`,
|
`Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.`,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,6 +29,6 @@ outputs:
|
|||||||
proxy_urls:
|
proxy_urls:
|
||||||
description: A stringified JSON array of objects containing the types and URLs of the configured registries.
|
description: A stringified JSON array of objects containing the types and URLs of the configured registries.
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: "../lib/start-proxy-entry.js"
|
main: "../lib/start-proxy-entry.js"
|
||||||
post: "../lib/start-proxy-post-entry.js"
|
post: "../lib/start-proxy-post-entry.js"
|
||||||
|
|||||||
@@ -41,6 +41,6 @@ outputs:
|
|||||||
|
|
||||||
{ "code-scanning": "some-id", "code-quality": "some-other-id" }
|
{ "code-scanning": "some-id", "code-quality": "some-other-id" }
|
||||||
runs:
|
runs:
|
||||||
using: node24
|
using: node20
|
||||||
main: '../lib/upload-sarif-entry.js'
|
main: '../lib/upload-sarif-entry.js'
|
||||||
post: '../lib/upload-sarif-post-entry.js'
|
post: '../lib/upload-sarif-post-entry.js'
|
||||||
|
|||||||
Reference in New Issue
Block a user