Compare commits

...

435 Commits

Author SHA1 Message Date
Michael B. Gale
1190a975f9 Merge pull request #4171 from github/backport-v3.38.2-2892aa5e1
Merge releases/v4 into releases/v3
2026-09-24 12:00:34 +01:00
github-actions[bot]
a09a142526 Rebuild 2026-09-24 10:29:19 +00:00
github-actions[bot]
aa62ed54ed Update version and changelog for v3.38.2 2026-09-24 10:29:11 +00:00
github-actions[bot]
aca72b1c31 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.38.2-2892aa5e1 2026-09-24 10:29:11 +00:00
github-actions[bot]
259e857114 Revert "Rebuild"
This reverts commit 39e5c2d42c.
2026-09-24 10:29:11 +00:00
github-actions[bot]
37fc051b5d Revert "Update version and changelog for v3.38.1"
This reverts commit d7512d4cfe.
2026-09-24 10:29:11 +00:00
Michael B. Gale
2892aa5e19 Merge pull request #4168 from github/update-v4.38.2-a6ef2c96f
Merge main into releases/v4
2026-09-24 11:26:28 +01:00
Michael B. Gale
8ad03a333e Trigger workflows 2026-09-24 11:15:21 +01:00
github-actions[bot]
98af865db5 Update changelog for v4.38.2 2026-09-24 10:01:43 +00:00
Michael B. Gale
a6ef2c96fc Merge pull request #4156 from github/mario-campos/fix-validate-cmd
Fix path-resolution bug in `changenotes.mts validate` by using `getChangenotes`
2026-09-24 08:16:09 +00:00
Michael B. Gale
1ef28a1b76 Merge pull request #4166 from github/dependabot/github_actions/dot-github/workflows/actions-minor-4c9e3e8b22
Bump ruby/setup-ruby from 1.321.0 to 1.323.0 in /.github/workflows in the actions-minor group across 1 directory
2026-09-24 08:02:30 +00:00
Michael B. Gale
26cb08bab0 Merge pull request #4163 from github/mbg/fix-getCommitOid-stubs
Fix `getCommitOid` stubs
2026-09-24 07:07:29 +00:00
Michael B. Gale
f035ce3a98 Merge pull request #4165 from github/dependabot/npm_and_yarn/npm-minor-8eaed9c323
Bump the npm-minor group across 1 directory with 3 updates
2026-09-23 18:11:21 +00:00
github-actions[bot]
5e4e2550b4 Rebuild 2026-09-23 17:57:57 +00:00
dependabot[bot]
b13f5f47d5 Bump ruby/setup-ruby
Bumps the actions-minor group with 1 update in the /.github/workflows directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby).


Updates `ruby/setup-ruby` from 1.321.0 to 1.323.0
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](95ef2b042f...984c0c8908)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-version: 1.323.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-23 17:56:05 +00:00
github-actions[bot]
c87fe5756c Rebuild 2026-09-23 17:55:50 +00:00
dependabot[bot]
becb485c9f Bump the npm-minor group across 1 directory with 3 updates
Bumps the npm-minor group with 3 updates in the / directory: [js-yaml](https://github.com/nodeca/js-yaml), [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) and [yaml](https://github.com/eemeli/yaml).


Updates `js-yaml` from 5.4.1 to 5.4.2
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.4.1...5.4.2)

Updates `eslint-plugin-jsdoc` from 64.3.8 to 64.5.2
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v64.3.8...v64.5.2)

Updates `yaml` from 2.9.0 to 2.9.1
- [Release notes](https://github.com/eemeli/yaml/releases)
- [Commits](https://github.com/eemeli/yaml/compare/v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-version: 5.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 64.5.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: yaml
  dependency-version: 2.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-23 17:54:02 +00:00
Michael B. Gale
42277414c7 Stub getCommitOid correctly and check calls 2026-09-23 13:38:53 +01:00
Michael B. Gale
9c9e4b034d Fix getCommitOid stubs 2026-09-23 13:31:48 +01:00
Michael B. Gale
f0064b219d Merge pull request #4162 from github/mbg/cli/disable-perfdata
Disable `UsePerfData` for `resolveExtractor`
2026-09-23 12:17:25 +00:00
Michael B. Gale
9691115b1c Disable UsePerfData for resolveExtractor 2026-09-23 11:29:17 +01:00
Michael B. Gale
41a4b9a4cd Merge pull request #4160 from github/update-bundle/codeql-bundle-v2.27.1
Update default bundle to 2.27.1
2026-09-22 17:53:51 +00:00
Henry Mercer
33141e5cce Merge pull request #4159 from github/henrymercer/pr-4146-follow-ups
Address per-language bundle review follow-ups
2026-09-22 17:17:15 +00:00
github-actions[bot]
81fb67799a Add changelog note 2026-09-22 17:12:17 +00:00
github-actions[bot]
53162242d5 Update default bundle to codeql-bundle-v2.27.1 2026-09-22 17:12:09 +00:00
Henry Mercer
3bacfe2c5b Remove trailing whitespace from nightly comment
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-22 16:56:15 +01:00
Henry Mercer
e574ef13a6 Merge main into per-language bundle follow-ups
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-22 16:54:25 +01:00
Henry Mercer
48321b2d48 Update src/per-language-bundles.ts
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-22 16:49:21 +01:00
Henry Mercer
f2ec2f6267 Tweak comment for latest nightly version check
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-09-22 16:23:55 +01:00
Henry Mercer
a9a8cd1aec Explain the nightly bundle version-check exception
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-22 16:07:10 +01:00
Henry Mercer
dba87a18dc Clarify elapsed-time helper documentation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-22 16:07:10 +01:00
Henry Mercer
06344e2ba1 Stub nightly release listing directly
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-22 16:07:09 +01:00
Henry Mercer
07dc94940e Use default state in per-language bundle tests
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-22 16:07:07 +01:00
Michael B. Gale
416ff0dea1 Merge pull request #4157 from github/mbg/refactor/checkout-path
Refactor how the `checkout_path` input is obtained
2026-09-22 14:04:08 +00:00
Mario Campos
738bd62186 Refactor changenotes validate to use helper getChangenotes
This reduces duplicate code between `assemble` and `validate`. It also has the benefit of fixing a bug in the current implementation of `validate`, where `isValidChangenoteFile` receives a relative file name where it should receive an absolute one.
2026-09-22 09:01:46 -05:00
Mario Campos
6dd161bc76 Merge pull request #4155 from github/mario-campos/merge-changenotes
Add `changenotes.mts assemble` command to move changenotes to CHANGELOG.md
2026-09-22 12:52:41 +00:00
Michael B. Gale
8a88af6849 Refactor cleanupAndUploadDatabases querying checkout_path itself 2026-09-22 11:17:02 +01:00
Michael B. Gale
ada4e83349 Refactor cleanupAndUploadOverlayBaseDatabaseToCache querying checkout_path itself 2026-09-22 10:54:07 +01:00
Michael B. Gale
3a30b151d6 Refactor setupDiffInformedQueryRun querying checkout_path itself 2026-09-22 10:53:49 +01:00
Michael B. Gale
669351e880 Replace getRequiredEnvParam calls in init and setup-codeql action 2026-09-22 10:53:27 +01:00
Mario Campos
b1668d6234 Flesh out a comment 2026-09-21 16:40:26 -05:00
Mario Campos
c0bd54fdf4 Replace JSDoc text with @throws 2026-09-21 16:36:10 -05:00
Mario Campos
0263122209 Format code with npm run lint-fix 2026-09-21 16:32:44 -05:00
Mario Campos
c496c6cceb Rename name to absolutePath for clarity 2026-09-21 16:31:55 -05:00
Mario Campos
598cda36cf Apply suggestion from @mbg
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-21 16:28:52 -05:00
Mario Campos
771560691a Update JSDoc comment with parameter lines
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-21 16:28:36 -05:00
Mario Campos
a92f7fb688 Refactor changenote file listing into function to D.R.Y. 2026-09-18 15:02:17 -05:00
Mario Campos
7f54212a01 Rename flush command to assemble 2026-09-18 13:49:18 -05:00
Mario Campos
977b29b897 Replace splice with push and pop 2026-09-18 13:47:06 -05:00
Mario Campos
bc0efd6d91 Simplify addBodyLinesToUnreleasedSection 2026-09-18 12:35:41 -05:00
Mario Campos
128614ad8b Simplify getHeader to operate on ChangelogSections 2026-09-18 12:24:19 -05:00
Mario Campos
d63b2a40db Assume '[UNRELEASED]' section is first section 2026-09-18 11:42:46 -05:00
Mario Campos
b246e56069 Use ExitCode instead of 0/1 2026-09-18 11:28:17 -05:00
Mario Campos
bffae1c4b8 Use withChangelog I/O helper 2026-09-18 11:24:26 -05:00
Mario Campos
1ee3265262 Add changenotes.mts flush command
This command will "flush" or move the changenotes in the `unreleased-change-notes` directory to the `[UNRELEASED]` section of the CHANGELOG.md file.
2026-09-18 11:14:49 -05:00
Mario Campos
bb1dc5460b Add CHANGELOG function addBodyLinesToUnreleasedSection
This will be used by the `pr-checks/changenotes.mts` script to "compile" the latest release entry of CHANGELOG.md.
2026-09-18 11:14:48 -05:00
Mario Campos
47d607e2c1 Add changelog parsing helper getHeader 2026-09-18 11:14:48 -05:00
Mario Campos
cb31eabcd8 Do not include trailing newlines in NO_CHANGES_STR
Changing `NO_CHANGES_STR` to just be the text will make it easier to insert/use. To not break anything, I added the deleted newlines to the locations where `NO_CHANGES_STR` was used.
2026-09-18 09:35:44 -05:00
Michael B. Gale
3ea06614da Merge pull request #4154 from github/backport-v3.38.1-1c5b67565
Merge releases/v4 into releases/v3
2026-09-18 15:06:05 +01:00
Michael B. Gale
a7afe0a2d7 Merge pull request #4153 from github/mergeback/v4.38.1-to-main-1c5b6756
Mergeback v4.38.1 refs/heads/releases/v4 into main
2026-09-18 13:40:20 +00:00
github-actions[bot]
39e5c2d42c Rebuild 2026-09-18 13:12:36 +00:00
github-actions[bot]
d7512d4cfe Update version and changelog for v3.38.1 2026-09-18 13:12:27 +00:00
github-actions[bot]
41500c6922 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.38.1-1c5b67565 2026-09-18 13:12:27 +00:00
github-actions[bot]
693d869c25 Revert "Rebuild"
This reverts commit 3490969653.
2026-09-18 13:12:27 +00:00
github-actions[bot]
dc38ccb025 Revert "Update version and changelog for v3.38.0"
This reverts commit ce74b7377b.
2026-09-18 13:12:27 +00:00
github-actions[bot]
f8b1c08e6d Rebuild 2026-09-18 13:11:23 +00:00
github-actions[bot]
ba80880079 Update changelog and version after v4.38.1 2026-09-18 13:11:14 +00:00
Michael B. Gale
1c5b675653 Merge pull request #4152 from github/update-v4.38.1-a65b83a73
Merge main into releases/v4
2026-09-18 14:09:51 +01:00
Michael B. Gale
a97cdcae05 Add changelog entry for #4146 2026-09-18 13:58:09 +01:00
github-actions[bot]
cc6c6911c3 Update changelog for v4.38.1 2026-09-18 12:46:37 +00:00
Michael B. Gale
a65b83a73d Merge pull request #4146 from github/henrymercer/per-language-bundles-pr
Use per-language CodeQL bundles
2026-09-18 12:30:36 +00:00
Henry Mercer
07fa87d333 Clarify the latest-nightly eligibility exception
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:08:05 +01:00
Henry Mercer
f18f3536f1 Describe the bundle URL resolver
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:07:06 +01:00
Henry Mercer
ecec9b5a37 Share per-language telemetry fields without renaming
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:06:17 +01:00
Henry Mercer
79fe3a1270 Move download telemetry into the status-report directory
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:04:38 +01:00
Henry Mercer
ead1f7d93f Rename the platform module
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:03:27 +01:00
Henry Mercer
549d498da3 Simplify per-language platform eligibility checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:02:12 +01:00
Henry Mercer
ed3a24ccbc Group bundle eligibility test state overrides
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:01:31 +01:00
Henry Mercer
28b8f598f5 Use shared test state for bundle eligibility
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 19:00:38 +01:00
Henry Mercer
a0cc01096a Merge pull request #4145 from github/henrymercer/bundle-resolution-pr
Separate CodeQL bundle resolution from installation
2026-09-17 14:31:25 +00:00
Henry Mercer
41c04be873 Use initAllState in bundle cleanup tests
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 14:35:02 +01:00
Henry Mercer
06f4ce74f9 Isolate bundle cleanup test environments
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-17 14:34:28 +01:00
Henry Mercer
5a2f29e0a1 Merge published per-language bundle history
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 20:27:35 +01:00
Henry Mercer
cf9bbfe9a1 Merge pull request #4150 from github/dependabot/npm_and_yarn/npm-minor-b347c7d8de
Bump the npm-minor group across 1 directory with 3 updates
2026-09-16 19:14:07 +00:00
Henry Mercer
69f47159b1 Use Result.orElse for bundle extraction paths
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:55:13 +01:00
Henry Mercer
f4fa111630 Share elapsed-time rounding for bundle downloads
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:51:23 +01:00
Henry Mercer
89606bbad1 Return toolcache rejection reasons with Result
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:43:05 +01:00
Henry Mercer
bd2ddba96c Extract explicit CodeQL bundle URL classification
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 19:36:07 +01:00
dependabot[bot]
ac47650173 Bump the npm-minor group across 1 directory with 3 updates
Bumps the npm-minor group with 3 updates in the / directory: [@eslint/compat](https://github.com/eslint/rewrite/tree/HEAD/packages/compat), [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint).


Updates `@eslint/compat` from 2.1.0 to 2.1.1
- [Release notes](https://github.com/eslint/rewrite/releases)
- [Changelog](https://github.com/eslint/rewrite/blob/main/packages/compat/CHANGELOG.md)
- [Commits](https://github.com/eslint/rewrite/commits/compat-v2.1.1/packages/compat)

Updates `eslint-plugin-jsdoc` from 64.3.4 to 64.3.8
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v64.3.4...v64.3.8)

Updates `typescript-eslint` from 8.69.0 to 8.70.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.70.0/packages/typescript-eslint)

---
updated-dependencies:
- dependency-name: "@eslint/compat"
  dependency-version: 2.1.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 64.3.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: typescript-eslint
  dependency-version: 8.70.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-16 17:54:39 +00:00
Henry Mercer
2f552a99f3 Clarify bundle resolution and latest-nightly selection
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:36:46 +01:00
Henry Mercer
f536ef48b7 Centralize CodeQL download telemetry fields
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:30:50 +01:00
Henry Mercer
dfb9bf52c9 Share CodeQL bundle platform definitions
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:28:00 +01:00
Henry Mercer
2d47caf123 Isolate per-language bundle eligibility state
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 17:25:24 +01:00
Henry Mercer
59ce3a25ba Include failed bundle attempts in fallback timing
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 16:56:49 +01:00
Henry Mercer
289376d7dd Use per-language CodeQL bundles
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 16:56:33 +01:00
Mario Campos
9961729e06 Merge pull request #4116 from github/mario-campos/validate-cn-workflow
Validate change-notes as a PR check
2026-09-16 15:12:11 +00:00
Michael B. Gale
7dbd038544 Merge pull request #4142 from github/mbg/copilot/update-instructions
Improve Copilot instructions
2026-09-16 13:03:53 +00:00
Henry Mercer
f3e0c870be Clarify resolved bundle handling
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-16 12:16:13 +01:00
Michael B. Gale
53e5014d5d Address review comments 2026-09-16 11:29:45 +01:00
Michael B. Gale
f959bfdc31 Merge remote-tracking branch 'origin/main' into mbg/copilot/update-instructions 2026-09-16 11:14:23 +01:00
Henry Mercer
eb76062ef2 Include failed bundle attempts in fallback timing
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 19:57:17 +01:00
Henry Mercer
ec5eecb246 Use per-language CodeQL bundles
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:17:16 +01:00
Henry Mercer
1970c450ec Separate CodeQL bundle resolution from installation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 15:25:18 +01:00
Mario Campos
e26a5c4139 Be consistent with language and conventions 2026-09-15 09:18:42 -05:00
Henry Mercer
f19a847dca Merge pull request #4135 from github/dependabot/npm_and_yarn/octokit/types-18.0.0
Bump @octokit/types from 17.0.0 to 18.0.0
2026-09-15 13:44:13 +00:00
Henry Mercer
d65664dcae Merge pull request #4138 from github/henrymercer/bundle-download-errors
Preserve HTTP errors from streaming bundle downloads
2026-09-15 12:36:14 +00:00
Henry Mercer
0224ca9728 Use a plain error when the HTTP status is unknown
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-15 12:55:26 +01:00
Mario Campos
6041eff66b Update validate.test.mts test names to reflect new isValidAllChangenoteFiles
The `isValidAllChangenoteFiles` now accepts a list of file paths rather than a file path string.
2026-09-14 13:40:10 -05:00
Mario Campos
f45ef9d1c5 Log something on successful changenote validation
Also, slightly improve the log statement of the validation error case.
2026-09-14 12:17:28 -05:00
Henry Mercer
13354125bc Omit unknown HTTP status codes from download errors
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-14 11:41:48 +01:00
Mario Campos
f60f4d9500 Validate change-notes in PRs
This commit also introduces the 'empty' home directory for future change-notes.
2026-09-11 16:04:21 -05:00
Mario Campos
a691c16115 Extend changetool to support directories 2026-09-11 16:04:21 -05:00
Mario Campos
b1c1bbb1e0 Extend ESLint rules to *.mts files 2026-09-11 14:52:02 -05:00
Mario Campos
1cf8f518e1 Merge pull request #4140 from github/mario-campos/move-withTmpFile
Move `withTmpFile` next to `withTmpDir`
2026-09-11 18:54:51 +00:00
Mario Campos
faf4f3af21 Add JSDoc to withTmpFile 2026-09-11 11:12:03 -05:00
Michael B. Gale
e72db597b8 Merge pull request #4143 from github/mbg/rename-script-to-changenote
Rename `validate-changelog` to `changenotes`
2026-09-11 15:09:33 +00:00
Mario Campos
15b91dbb92 Delete unnecessary .js file extension from import statement
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-09-11 08:57:52 -05:00
Michael B. Gale
27a821e701 Rename validate-changelog to changenotes 2026-09-11 14:46:35 +01:00
Michael B. Gale
cc78526536 Improve Copilot instructions 2026-09-11 14:19:19 +01:00
Michael B. Gale
032138d5fb Merge pull request #4141 from github/mario-campos/finally-clean-withTmpDir
Always clean-up temp dirs in `withTmpDir`
2026-09-11 13:12:42 +00:00
Michael B. Gale
7be8083b7e Merge pull request #4139 from github/mbg/10sep26-deps
Update dependencies
2026-09-11 11:33:48 +00:00
Mario Campos
80d5f4e36a Always clean-up temp dirs in withTmpDir 2026-09-10 18:48:14 -05:00
Mario Campos
297617deb9 Update npm commands in sync.sh to include workspace root dependencies 2026-09-10 17:22:50 -05:00
Mario Campos
f6491d646e Reduce duplication by using withTmpDir in withTmpFile 2026-09-10 15:37:39 -05:00
Mario Campos
4375107b7e Move withTmpFile to util.ts and update tests to use it 2026-09-10 15:36:26 -05:00
Michael B. Gale
a50b659501 Update dependencies 2026-09-10 20:32:49 +01:00
Henry Mercer
5bdaf5d4af Preserve HTTP errors from streaming bundle downloads
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-10 19:05:41 +01:00
Michael B. Gale
14c568a926 Merge pull request #4128 from github/mbg/move-changetool
Migrate `changetool` to `pr-checks`
2026-09-10 16:42:38 +00:00
Michael B. Gale
0484c3ad1d Merge remote-tracking branch 'origin/main' into mbg/move-changetool 2026-09-10 17:09:46 +01:00
Michael B. Gale
aaa014366e Remove unneeded Promise.resolve 2026-09-10 16:59:12 +01:00
dependabot[bot]
5bd5bf93f2 Bump @octokit/types from 17.0.0 to 18.0.0
Bumps [@octokit/types](https://github.com/octokit/types.ts) from 17.0.0 to 18.0.0.
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v17.0.0...v18.0.0)

---
updated-dependencies:
- dependency-name: "@octokit/types"
  dependency-version: 18.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-10 11:00:56 +00:00
Michael B. Gale
5584cec589 Merge pull request #4134 from github/dependabot/npm_and_yarn/npm-minor-a30b170aad
Bump the npm-minor group across 1 directory with 6 updates
2026-09-10 10:47:33 +00:00
Michael B. Gale
d9826583a3 Merge pull request #4136 from github/dependabot/github_actions/dot-github/workflows/actions-minor-4cf73e6ad1
Bump actions/setup-java from 6.0.0 to 6.0.1 in /.github/workflows in the actions-minor group across 1 directory
2026-09-10 10:34:38 +00:00
github-actions[bot]
9f28912d94 Rebuild 2026-09-09 17:58:17 +00:00
github-actions[bot]
d9ef050686 Rebuild 2026-09-09 17:56:37 +00:00
dependabot[bot]
a72798355c Bump actions/setup-java
Bumps the actions-minor group with 1 update in the /.github/workflows directory: [actions/setup-java](https://github.com/actions/setup-java).


Updates `actions/setup-java` from 6.0.0 to 6.0.1
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](dd06d9cba3...de7274f081)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-09 17:56:16 +00:00
dependabot[bot]
d40707c73d Bump the npm-minor group across 1 directory with 6 updates
Bumps the npm-minor group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@octokit/core](https://github.com/octokit/core.js) | `7.0.7` | `7.0.8` |
| [js-yaml](https://github.com/nodeca/js-yaml) | `5.4.0` | `5.4.1` |
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `64.2.1` | `64.3.4` |
| [globals](https://github.com/sindresorhus/globals) | `17.11.0` | `17.12.0` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.68.0` | `8.69.0` |
| [tsx](https://github.com/privatenumber/tsx) | `4.23.12` | `4.23.13` |



Updates `@octokit/core` from 7.0.7 to 7.0.8
- [Release notes](https://github.com/octokit/core.js/releases)
- [Commits](https://github.com/octokit/core.js/compare/v7.0.7...v7.0.8)

Updates `js-yaml` from 5.4.0 to 5.4.1
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/5.4.0...5.4.1)

Updates `eslint-plugin-jsdoc` from 64.2.1 to 64.3.4
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v64.2.1...v64.3.4)

Updates `globals` from 17.11.0 to 17.12.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.11.0...v17.12.0)

Updates `typescript-eslint` from 8.68.0 to 8.69.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.69.0/packages/typescript-eslint)

Updates `tsx` from 4.23.12 to 4.23.13
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](https://github.com/privatenumber/tsx/compare/v4.23.12...v4.23.13)

---
updated-dependencies:
- dependency-name: "@octokit/core"
  dependency-version: 7.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: js-yaml
  dependency-version: 5.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 64.3.4
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: globals
  dependency-version: 17.12.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: typescript-eslint
  dependency-version: 8.69.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: tsx
  dependency-version: 4.23.13
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-09 17:54:35 +00:00
Henry Mercer
e855781840 Merge pull request #4132 from github/mergeback/v4.38.0-to-main-b96794f0
Mergeback v4.38.0 refs/heads/releases/v4 into main
2026-09-09 15:16:08 +00:00
Henry Mercer
faaca9a8f6 Merge pull request #4133 from github/backport-v3.38.0-b96794f01
Merge releases/v4 into releases/v3
2026-09-09 15:51:52 +01:00
github-actions[bot]
3490969653 Rebuild 2026-09-09 14:37:28 +00:00
github-actions[bot]
ce74b7377b Update version and changelog for v3.38.0 2026-09-09 14:37:15 +00:00
github-actions[bot]
739ee7214d Merge remote-tracking branch 'origin/releases/v4' into backport-v3.38.0-b96794f01 2026-09-09 14:37:15 +00:00
github-actions[bot]
a3c61c3ab4 Revert "Rebuild"
This reverts commit 2907452324.
2026-09-09 14:37:15 +00:00
github-actions[bot]
16e21b98bd Revert "Update version and changelog for v3.37.9"
This reverts commit a4f1d2dfeb.
2026-09-09 14:37:14 +00:00
github-actions[bot]
23a5edca55 Rebuild 2026-09-09 14:04:19 +00:00
github-actions[bot]
6f5a84b5b5 Update changelog and version after v4.38.0 2026-09-09 14:04:04 +00:00
Henry Mercer
b96794f015 Merge pull request #4131 from github/update-v4.38.0-7e08580a9
Merge main into releases/v4
2026-09-09 15:02:30 +01:00
github-actions[bot]
02d5093871 Update changelog for v4.38.0 2026-09-09 12:33:07 +00:00
Henry Mercer
7e08580a93 Merge pull request #4130 from github/henrymercer/workflow-runner-sizing
Run slow macOS checks on larger runners
2026-09-09 12:16:50 +00:00
Henry Mercer
bfcc52b4f5 Run slow macOS checks on larger runners
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 12:57:40 +01:00
Henry Mercer
8c251e757c Merge pull request #4129 from github/update-bundle/codeql-bundle-v2.27.0
Update default bundle to 2.27.0
2026-09-09 11:48:16 +00:00
github-actions[bot]
0b7ca400df Add changelog note 2026-09-09 11:33:54 +00:00
github-actions[bot]
40484b3395 Update default bundle to codeql-bundle-v2.27.0 2026-09-09 11:33:48 +00:00
Michael B. Gale
d23593114c Address linter errors in validate.test.mts 2026-09-09 11:44:24 +01:00
Michael B. Gale
b1363526cf Fix some formatting in pr-checks.yml 2026-09-09 11:44:23 +01:00
Michael B. Gale
83d1431d4e Migrate changetool to pr-checks 2026-09-09 11:44:23 +01:00
Henry Mercer
6f5948dfac Merge pull request #4109 from github/backport-v3.37.9-cdf488f59
Merge releases/v4 into releases/v3
2026-08-26 18:02:02 +01:00
github-actions[bot]
2907452324 Rebuild 2026-08-26 14:42:27 +00:00
github-actions[bot]
a4f1d2dfeb Update version and changelog for v3.37.9 2026-08-26 14:42:12 +00:00
github-actions[bot]
a87239a309 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.9-cdf488f59 2026-08-26 14:42:12 +00:00
github-actions[bot]
c68e6e8e04 Revert "Rebuild"
This reverts commit 771aacb2ad.
2026-08-26 14:42:12 +00:00
github-actions[bot]
65e1329896 Revert "Update version and changelog for v3.37.8"
This reverts commit 0692998c5c.
2026-08-26 14:42:12 +00:00
Henry Mercer
42947a3404 Merge pull request #4104 from github/backport-v3.37.8-db488ddef
Merge releases/v4 into releases/v3
2026-08-21 13:48:33 +01:00
github-actions[bot]
771aacb2ad Rebuild 2026-08-21 12:27:02 +00:00
github-actions[bot]
0692998c5c Update version and changelog for v3.37.8 2026-08-21 12:26:47 +00:00
github-actions[bot]
57a845ca5d Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.8-db488ddef 2026-08-21 12:26:47 +00:00
github-actions[bot]
2b5f0e6784 Revert "Rebuild"
This reverts commit 2a073c8c9a.
2026-08-21 12:26:47 +00:00
github-actions[bot]
77571dc418 Revert "Update version and changelog for v3.37.7"
This reverts commit 5f47b57df6.
2026-08-21 12:26:47 +00:00
Michael B. Gale
f3712979fa Merge pull request #4095 from github/backport-v3.37.7-ff2f1c621
Merge releases/v4 into releases/v3
2026-08-13 14:57:21 +01:00
github-actions[bot]
2a073c8c9a Rebuild 2026-08-13 13:31:29 +00:00
github-actions[bot]
5f47b57df6 Update version and changelog for v3.37.7 2026-08-13 13:31:20 +00:00
github-actions[bot]
272e6d3b25 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.7-ff2f1c621 2026-08-13 13:31:20 +00:00
github-actions[bot]
4da5eae9f4 Revert "Rebuild"
This reverts commit b4d147f9bc.
2026-08-13 13:31:20 +00:00
github-actions[bot]
8b2ec470a0 Revert "Update version and changelog for v3.37.6"
This reverts commit f6580d2b8f.
2026-08-13 13:31:20 +00:00
Michael B. Gale
c4dd10e44a Merge pull request #4074 from github/backport-v3.37.6-5595ccaf9
Merge releases/v4 into releases/v3
2026-08-04 15:34:13 +01:00
Michael B. Gale
2ba473f582 Trigger workflows 2026-08-04 15:21:43 +01:00
github-actions[bot]
b4d147f9bc Rebuild 2026-08-04 13:36:10 +00:00
github-actions[bot]
f6580d2b8f Update version and changelog for v3.37.6 2026-08-04 13:36:01 +00:00
github-actions[bot]
5e7686d132 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.6-5595ccaf9 2026-08-04 13:36:01 +00:00
github-actions[bot]
324dd69df0 Revert "Rebuild"
This reverts commit 01b30f9112.
2026-08-04 13:36:00 +00:00
github-actions[bot]
200d550080 Revert "Update version and changelog for v3.37.5"
This reverts commit f44d029dbc.
2026-08-04 13:36:00 +00:00
Henry Mercer
e60ea984bd Merge pull request #4069 from github/backport-v3.37.5-d1ba80a13
Merge releases/v4 into releases/v3
2026-08-03 12:29:14 +01:00
github-actions[bot]
01b30f9112 Rebuild 2026-08-03 11:09:54 +00:00
github-actions[bot]
f44d029dbc Update version and changelog for v3.37.5 2026-08-03 11:09:41 +00:00
github-actions[bot]
a7b3986136 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.5-d1ba80a13 2026-08-03 11:09:40 +00:00
github-actions[bot]
5667eabe3b Revert "Rebuild"
This reverts commit 85722ca3f8.
2026-08-03 11:09:40 +00:00
github-actions[bot]
2c538e6403 Revert "Update version and changelog for v3.37.4"
This reverts commit 93539ac81b.
2026-08-03 11:09:40 +00:00
Michael B. Gale
fa3b8d4aca Merge pull request #4060 from github/fix/revert-rebuild
Fix `releases/v3` branch
2026-07-31 12:05:49 +01:00
Michael B. Gale
85722ca3f8 Rebuild 2026-07-30 18:08:41 +01:00
github-actions[bot]
93539ac81b Update version and changelog for v3.37.4 2026-07-30 18:08:17 +01:00
Michael B. Gale
a2225dced3 Resolve merge conflict 2026-07-30 18:05:04 +01:00
Michael B. Gale
4d950cddc8 Revert "Rebuild"
This reverts commit 30d6d12c17.
2026-07-30 18:04:02 +01:00
Michael B. Gale
b7ae332965 Revert "Update version and changelog for v3.37.4"
This reverts commit 14e2e60bf8.
2026-07-30 18:03:51 +01:00
Óscar San José
a2983b8bed Merge pull request #4058 from github/backport-v3.37.4-f205ea1c3
Merge releases/v4 into releases/v3
2026-07-30 15:37:05 +02:00
Óscar San José
30d6d12c17 Rebuild 2026-07-30 13:55:35 +02:00
github-actions[bot]
14e2e60bf8 Update version and changelog for v3.37.4 2026-07-30 09:22:37 +00:00
github-actions[bot]
5d3f01e177 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.4-f205ea1c3
# Conflicts:
#	lib/entry-points.js
2026-07-30 09:22:37 +00:00
github-actions[bot]
3f405c7726 Revert "Rebuild"
This reverts commit ae71ce6a2d.
2026-07-30 09:22:37 +00:00
github-actions[bot]
19d11a3383 Revert "Update version and changelog for v3.37.3"
This reverts commit d2305d0114.
2026-07-30 09:22:37 +00:00
Michael B. Gale
4187e74d05 Merge pull request #4034 from github/backport-v3.37.3-e4fba868f
Merge releases/v4 into releases/v3
2026-07-22 07:01:42 +01:00
Michael B. Gale
ae71ce6a2d Rebuild 2026-07-22 06:45:17 +01:00
github-actions[bot]
d2305d0114 Update version and changelog for v3.37.3 2026-07-22 05:38:23 +00:00
github-actions[bot]
994a21a0b3 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.3-e4fba868f
# Conflicts:
#	lib/entry-points.js
2026-07-22 05:38:23 +00:00
github-actions[bot]
0c52f3f086 Revert "Rebuild"
This reverts commit 74406f0856.
2026-07-22 05:38:22 +00:00
github-actions[bot]
933494d539 Revert "Update version and changelog for v3.37.2"
This reverts commit 8dfbacbba5.
2026-07-22 05:38:22 +00:00
Michael B. Gale
08d09a53f0 Merge pull request #4029 from github/backport-v3.37.2-e0647621c
Merge releases/v4 into releases/v3
2026-07-21 16:06:02 +01:00
Michael B. Gale
74406f0856 Rebuild 2026-07-21 15:31:11 +01:00
github-actions[bot]
8dfbacbba5 Update version and changelog for v3.37.2 2026-07-21 14:28:11 +00:00
github-actions[bot]
ab2931b320 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.2-e0647621c
# Conflicts:
#	lib/entry-points.js
2026-07-21 14:28:11 +00:00
github-actions[bot]
c87e7fae54 Revert "Rebuild"
This reverts commit 1138fefa2b.
2026-07-21 14:28:11 +00:00
github-actions[bot]
5a1ba3bdf6 Revert "Update version and changelog for v3.37.1"
This reverts commit 3fa858af16.
2026-07-21 14:28:10 +00:00
Óscar San José
b7351df727 Merge pull request #4022 from github/backport-v3.37.1-7188fc363
Merge releases/v4 into releases/v3
2026-07-16 20:17:18 +02:00
Óscar San José
27e669d3d6 run pr-checks/sync-back.ts 2026-07-16 18:57:25 +02:00
Óscar San José
1138fefa2b Rebuild 2026-07-16 18:36:30 +02:00
github-actions[bot]
3fa858af16 Update version and changelog for v3.37.1 2026-07-16 15:38:11 +00:00
github-actions[bot]
4b646a0e5d Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.1-7188fc363
# Conflicts:
#	lib/entry-points.js
2026-07-16 15:38:11 +00:00
github-actions[bot]
44c5914b66 Revert "Rebuild"
This reverts commit af1b30ee40.
2026-07-16 15:38:10 +00:00
github-actions[bot]
0d531cfd92 Revert "Update version and changelog for v3.37.0"
This reverts commit 530c909a55.
2026-07-16 15:38:10 +00:00
Michael B. Gale
02c5e83432 Merge pull request #3998 from github/backport-v3.37.0-99df26d4f
Merge releases/v4 into releases/v3
2026-07-08 14:15:11 +01:00
Michael B. Gale
af1b30ee40 Rebuild 2026-07-08 13:43:18 +01:00
github-actions[bot]
530c909a55 Update version and changelog for v3.37.0 2026-07-08 12:11:58 +00:00
github-actions[bot]
0507814306 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.37.0-99df26d4f
# Conflicts:
#	lib/entry-points.js
2026-07-08 12:11:58 +00:00
github-actions[bot]
157d34d3cf Revert "Rebuild"
This reverts commit d56b7d789e.
2026-07-08 12:11:58 +00:00
github-actions[bot]
b8c8426f7c Revert "Update version and changelog for v3.36.3"
This reverts commit 66185e671d.
2026-07-08 12:11:58 +00:00
Michael B. Gale
411c4c9a36 Merge pull request #3992 from github/backport-v3.36.3-54f647b7e
Merge releases/v4 into releases/v3
2026-07-02 12:09:38 +01:00
github-actions[bot]
6153c156f7 Rebuild and trigger workflows 2026-07-02 11:56:57 +01:00
github-actions[bot]
66185e671d Update version and changelog for v3.36.3 2026-07-02 09:32:14 +00:00
github-actions[bot]
51edd47ebb Merge remote-tracking branch 'origin/releases/v4' into backport-v3.36.3-54f647b7e 2026-07-02 09:32:14 +00:00
github-actions[bot]
a90bc064bf Revert "Rebuild"
This reverts commit 0d313a3b02.
2026-07-02 09:32:13 +00:00
github-actions[bot]
ac8484ec8f Revert "Update version and changelog for v3.36.2"
This reverts commit ee98575270.
2026-07-02 09:32:13 +00:00
Henry Mercer
dd903d2e4f Merge pull request #3952 from github/backport-v3.36.2-8aad20d15
Merge releases/v4 into releases/v3
2026-06-04 15:51:55 +01:00
github-actions[bot]
0d313a3b02 Rebuild 2026-06-04 14:29:11 +00:00
github-actions[bot]
ee98575270 Update version and changelog for v3.36.2 2026-06-04 14:28:59 +00:00
github-actions[bot]
7d9a983ed4 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.36.2-8aad20d15 2026-06-04 14:28:59 +00:00
github-actions[bot]
6016976cee Revert "Rebuild"
This reverts commit e816d2e818.
2026-06-04 14:28:58 +00:00
github-actions[bot]
72c906de81 Revert "Update version and changelog for v3.36.1"
This reverts commit b6eff7b44a.
2026-06-04 14:28:58 +00:00
Henry Mercer
d77b13a0df Merge pull request #3942 from github/backport-v3.36.1-87557b9c8
Merge releases/v4 into releases/v3
2026-06-02 11:35:41 +01:00
github-actions[bot]
e816d2e818 Rebuild 2026-06-02 10:11:09 +00:00
github-actions[bot]
b6eff7b44a Update version and changelog for v3.36.1 2026-06-02 10:10:55 +00:00
github-actions[bot]
3b37ae1c9b Merge remote-tracking branch 'origin/releases/v4' into backport-v3.36.1-87557b9c8 2026-06-02 10:10:55 +00:00
github-actions[bot]
2587a4beb2 Revert "Rebuild"
This reverts commit bc887cab05.
2026-06-02 10:10:55 +00:00
github-actions[bot]
c02b552b1a Revert "Update version and changelog for v3.36.0"
This reverts commit a9739a6bf0.
2026-06-02 10:10:55 +00:00
Óscar San José
03e4368ac7 Merge pull request #3929 from github/backport-v3.36.0-7211b7c80
Merge releases/v4 into releases/v3
2026-05-22 13:27:24 +02:00
github-actions[bot]
bc887cab05 Rebuild 2026-05-22 11:10:26 +00:00
github-actions[bot]
a9739a6bf0 Update version and changelog for v3.36.0 2026-05-22 11:10:14 +00:00
github-actions[bot]
2be5c61e31 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.36.0-7211b7c80 2026-05-22 11:10:14 +00:00
github-actions[bot]
9b64c8b76e Revert "Rebuild"
This reverts commit 4b79f1ba10.
2026-05-22 11:10:14 +00:00
github-actions[bot]
c45c87a4c5 Revert "Update version and changelog for v3.35.5"
This reverts commit b2dd803f6e.
2026-05-22 11:10:14 +00:00
Michael B. Gale
458d36d7d4 Merge pull request #3907 from github/backport-v3.35.5-9e0d7b8d2
Merge releases/v4 into releases/v3
2026-05-15 13:40:29 +01:00
Michael B. Gale
70a1165f9a Resolve conflicts in action.yml files 2026-05-15 13:21:17 +01:00
github-actions[bot]
4b79f1ba10 Rebuild 2026-05-15 12:17:32 +00:00
github-actions[bot]
b2dd803f6e Update version and changelog for v3.35.5 2026-05-15 11:26:47 +00:00
github-actions[bot]
0e6a98bb2f Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35.5-9e0d7b8d2
# Conflicts:
#	analyze/action.yml
#	autobuild/action.yml
#	init/action.yml
#	resolve-environment/action.yml
#	setup-codeql/action.yml
#	start-proxy/action.yml
#	upload-sarif/action.yml
2026-05-15 11:26:47 +00:00
github-actions[bot]
cb4dbcd837 Revert "Rebuild"
This reverts commit ea18e99ca3.
2026-05-15 11:26:46 +00:00
github-actions[bot]
cad7075882 Revert "Update version and changelog for v3.35.4"
This reverts commit 19f4654991.
2026-05-15 11:26:45 +00:00
Paolo Tranquilli
7fd177fa68 Merge pull request #3887 from github/backport-v3.35.4-68bde559d
Merge releases/v4 into releases/v3
2026-05-08 08:19:44 +02:00
github-actions[bot]
ea18e99ca3 Rebuild 2026-05-07 16:19:46 +00:00
github-actions[bot]
19f4654991 Update version and changelog for v3.35.4 2026-05-07 15:56:10 +00:00
github-actions[bot]
8f15c6f1ad Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35.4-68bde559d 2026-05-07 15:56:06 +00:00
github-actions[bot]
349cedea3b Revert "Rebuild"
This reverts commit 30f0c9d081.
2026-05-07 15:56:06 +00:00
github-actions[bot]
f0ffd5714c Revert "Update version and changelog for v3.35.3"
This reverts commit 3530cdd15e.
2026-05-07 15:56:05 +00:00
Michael B. Gale
0daab03d71 Merge pull request #3869 from github/backport-v3.35.3-e46ed2cbd 2026-05-01 15:42:49 +01:00
github-actions[bot]
30f0c9d081 Rebuild 2026-05-01 14:16:34 +00:00
github-actions[bot]
3530cdd15e Update version and changelog for v3.35.3 2026-05-01 14:09:52 +00:00
github-actions[bot]
8280251823 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35.3-e46ed2cbd 2026-05-01 14:09:51 +00:00
github-actions[bot]
e511c7b2e0 Revert "Rebuild"
This reverts commit c186c7b484.
2026-05-01 14:09:50 +00:00
github-actions[bot]
50052a22af Revert "Update version and changelog for v3.35.2"
This reverts commit 8bcc8f23a2.
2026-05-01 14:09:50 +00:00
Henry Mercer
ce64ddcb0d Merge pull request #3826 from github/backport-v3.35.2-95e58e9a2
Merge releases/v4 into releases/v3
2026-04-15 12:51:20 +01:00
github-actions[bot]
c186c7b484 Rebuild 2026-04-15 11:30:55 +00:00
github-actions[bot]
8bcc8f23a2 Update version and changelog for v3.35.2 2026-04-15 11:26:58 +00:00
github-actions[bot]
834786ac9b Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35.2-95e58e9a2 2026-04-15 11:26:57 +00:00
github-actions[bot]
047c547345 Revert "Rebuild"
This reverts commit 646729a1e2.
2026-04-15 11:26:56 +00:00
github-actions[bot]
7ca215887b Revert "Update version and changelog for v3.35.1"
This reverts commit c983cb8e74.
2026-04-15 11:26:56 +00:00
Henry Mercer
5c8a8a642e Merge pull request #3784 from github/backport-v3.35.1-c10b8064d
Merge releases/v4 into releases/v3
2026-03-27 16:41:10 +00:00
github-actions[bot]
646729a1e2 Rebuild 2026-03-27 16:19:35 +00:00
github-actions[bot]
c983cb8e74 Update version and changelog for v3.35.1 2026-03-27 16:13:31 +00:00
github-actions[bot]
557b58c47c Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35.1-c10b8064d 2026-03-27 16:13:29 +00:00
github-actions[bot]
8bb5bdb9fd Revert "Rebuild"
This reverts commit b1a5f00cf1.
2026-03-27 16:13:29 +00:00
github-actions[bot]
4d2fde9e07 Revert "Update version and changelog for v3.35.0"
This reverts commit 124f6eec3b.
2026-03-27 16:13:29 +00:00
Óscar San José
13efb23391 Merge pull request #3778 from github/backport-v3.35.0-b8bb9f28b
Merge releases/v4 into releases/v3
2026-03-27 17:00:05 +01:00
github-actions[bot]
b1a5f00cf1 Rebuild 2026-03-27 12:23:35 +00:00
github-actions[bot]
124f6eec3b Update version and changelog for v3.35.0 2026-03-27 12:18:22 +00:00
github-actions[bot]
a88fb3cde0 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.35.0-b8bb9f28b 2026-03-27 12:18:20 +00:00
github-actions[bot]
57d591c67c Revert "Rebuild"
This reverts commit 97fd992228.
2026-03-27 12:18:20 +00:00
github-actions[bot]
dba1849cf2 Revert "Update version and changelog for v3.34.1"
This reverts commit 95a562052b.
2026-03-27 12:18:20 +00:00
Henry Mercer
ebcb5b36de Merge pull request #3765 from github/backport-v3.34.1-386975555
Merge releases/v4 into releases/v3
2026-03-20 18:37:00 +00:00
github-actions[bot]
97fd992228 Rebuild 2026-03-20 18:19:37 +00:00
github-actions[bot]
95a562052b Update version and changelog for v3.34.1 2026-03-20 18:16:44 +00:00
github-actions[bot]
ae8b37eb31 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.34.1-386975555 2026-03-20 18:16:42 +00:00
github-actions[bot]
d75030c604 Revert "Rebuild"
This reverts commit c146cd2193.
2026-03-20 18:16:42 +00:00
github-actions[bot]
a777590c0f Revert "Update version and changelog for v3.34.0"
This reverts commit 3fef31e9b5.
2026-03-20 18:16:41 +00:00
Óscar San José
dfad8f8ebc Merge pull request #3590 from github/backport-v3.34.0-c6f931105
Merge releases/v4 into releases/v3
2026-03-20 16:15:08 +01:00
github-actions[bot]
c146cd2193 Rebuild 2026-03-20 12:03:47 +00:00
github-actions[bot]
3fef31e9b5 Update version and changelog for v3.34.0 2026-03-20 11:59:46 +00:00
github-actions[bot]
3d7478b23a Merge remote-tracking branch 'origin/releases/v4' into backport-v3.34.0-c6f931105 2026-03-20 11:59:44 +00:00
github-actions[bot]
f874badee7 Revert "Rebuild"
This reverts commit 9ed0d758ce.
2026-03-20 11:59:44 +00:00
github-actions[bot]
1c3843e226 Revert "Update version and changelog for v3.33.0"
This reverts commit 2da877a512.
2026-03-20 11:59:44 +00:00
Michael B. Gale
603b797f8b Merge pull request #3577 from github/backport-v3.33.0-b1bff8193
Merge releases/v4 into releases/v3
2026-03-16 12:23:22 +00:00
github-actions[bot]
9ed0d758ce Rebuild 2026-03-16 11:10:08 +00:00
github-actions[bot]
2da877a512 Update version and changelog for v3.33.0 2026-03-16 09:08:36 +00:00
github-actions[bot]
4ccf9a5deb Merge remote-tracking branch 'origin/releases/v4' into backport-v3.33.0-b1bff8193 2026-03-16 09:08:34 +00:00
github-actions[bot]
e50ab6dc1d Revert "Rebuild"
This reverts commit dabb34c95a.
2026-03-16 09:08:33 +00:00
github-actions[bot]
ee6db5e4f5 Revert "Update version and changelog for v3.32.6"
This reverts commit c0e7770e36.
2026-03-16 09:08:33 +00:00
Óscar San José
820e3160e2 Merge pull request #3553 from github/backport-v3.32.6-0d579ffd0
Merge releases/v4 into releases/v3
2026-03-06 10:44:37 +01:00
github-actions[bot]
dabb34c95a Rebuild 2026-03-05 19:44:24 +00:00
github-actions[bot]
c0e7770e36 Update version and changelog for v3.32.6 2026-03-05 19:35:55 +00:00
github-actions[bot]
dbc2ac9b7a Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.6-0d579ffd0 2026-03-05 19:35:54 +00:00
github-actions[bot]
e61b8b4cf5 Revert "Rebuild"
This reverts commit b58ecf644d.
2026-03-05 19:35:53 +00:00
github-actions[bot]
b7ebceaf1a Revert "Update version and changelog for v3.32.5"
This reverts commit e3632d0ee3.
2026-03-05 19:35:53 +00:00
Henry Mercer
ae9ef3a1d2 Merge pull request #3533 from github/backport-v3.32.5-c793b717b
Merge releases/v4 into releases/v3
2026-03-02 12:01:34 +00:00
github-actions[bot]
b58ecf644d Rebuild 2026-03-02 11:34:55 +00:00
github-actions[bot]
e3632d0ee3 Update version and changelog for v3.32.5 2026-03-02 11:17:26 +00:00
github-actions[bot]
cdcb071e67 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.5-c793b717b 2026-03-02 11:17:25 +00:00
github-actions[bot]
177cb24be1 Revert "Rebuild"
This reverts commit a3696cdbdf.
2026-03-02 11:17:24 +00:00
github-actions[bot]
2427cfc4a9 Revert "Update version and changelog for v3.32.4"
This reverts commit 147ec67ee5.
2026-03-02 11:17:23 +00:00
Michael B. Gale
45580472a5 Merge pull request #3496 from github/backport-v3.32.4-89a39a4e5 2026-02-20 15:34:23 +00:00
github-actions[bot]
a3696cdbdf Rebuild 2026-02-20 14:52:56 +00:00
github-actions[bot]
147ec67ee5 Update version and changelog for v3.32.4 2026-02-20 14:21:14 +00:00
github-actions[bot]
acb91bd91f Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.4-89a39a4e5 2026-02-20 14:21:13 +00:00
github-actions[bot]
88d9aba91d Revert "Rebuild"
This reverts commit 70a71a57dd.
2026-02-20 14:21:12 +00:00
github-actions[bot]
72edeaa05b Revert "Update version and changelog for v3.32.3"
This reverts commit 676a1ceb5c.
2026-02-20 14:21:12 +00:00
Henry Mercer
f5c2471be7 Merge pull request #3481 from github/backport-v3.32.3-9e907b5e6
Merge releases/v4 into releases/v3
2026-02-13 12:21:24 +00:00
github-actions[bot]
70a71a57dd Rebuild 2026-02-13 12:01:04 +00:00
github-actions[bot]
676a1ceb5c Update version and changelog for v3.32.3 2026-02-13 11:55:54 +00:00
github-actions[bot]
e127ec2647 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.3-9e907b5e6 2026-02-13 11:55:52 +00:00
github-actions[bot]
f5e6f52190 Revert "Rebuild"
This reverts commit bb159524f9.
2026-02-13 11:55:52 +00:00
github-actions[bot]
e2a90d3e23 Revert "Update version and changelog for v3.32.2"
This reverts commit 6b68dd5d27.
2026-02-13 11:55:52 +00:00
Henry Mercer
b5ebac6f4c Merge pull request #3463 from github/backport-v3.32.2-45cbd0c69
Merge releases/v4 into releases/v3
2026-02-06 11:22:57 +00:00
github-actions[bot]
bb159524f9 Rebuild 2026-02-06 11:00:51 +00:00
github-actions[bot]
6b68dd5d27 Update version and changelog for v3.32.2 2026-02-05 17:12:29 +00:00
github-actions[bot]
24e739f51f Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.2-45cbd0c69 2026-02-05 17:12:25 +00:00
github-actions[bot]
e5a63de15c Revert "Rebuild"
This reverts commit fd13ffa22c.
2026-02-05 17:12:25 +00:00
github-actions[bot]
c2d57b0fc7 Revert "Update version and changelog for v3.32.1"
This reverts commit ce04bc5815.
2026-02-05 17:12:24 +00:00
Henry Mercer
2588666de8 Merge pull request #3449 from github/backport-v3.32.1-6bc82e05f
Merge releases/v4 into releases/v3
2026-02-02 07:47:27 -08:00
github-actions[bot]
fd13ffa22c Rebuild 2026-02-02 15:21:36 +00:00
github-actions[bot]
ce04bc5815 Update version and changelog for v3.32.1 2026-02-02 15:14:15 +00:00
github-actions[bot]
27eb5f56eb Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.1-6bc82e05f 2026-02-02 15:14:12 +00:00
github-actions[bot]
44f67f0887 Revert "Rebuild"
This reverts commit f5ab452606.
2026-02-02 15:14:12 +00:00
github-actions[bot]
5d24c86a89 Revert "Update version and changelog for v3.32.0"
This reverts commit 56c8e1c8a8.
2026-02-02 15:14:12 +00:00
Henry Mercer
439137e1b5 Merge pull request #3430 from github/backport-v3.32.0-b20883b0c
Merge releases/v4 into releases/v3
2026-01-26 11:23:41 -08:00
github-actions[bot]
f5ab452606 Rebuild 2026-01-26 18:54:38 +00:00
github-actions[bot]
56c8e1c8a8 Update version and changelog for v3.32.0 2026-01-26 18:41:33 +00:00
github-actions[bot]
4f5ca6f9a5 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.32.0-b20883b0c 2026-01-26 18:41:32 +00:00
github-actions[bot]
92f3a2822b Revert "Rebuild"
This reverts commit c9e0329cc4.
2026-01-26 18:41:32 +00:00
github-actions[bot]
e9bf22fb0e Revert "Update version and changelog for v3.31.11"
This reverts commit 9ffacc75e8.
2026-01-26 18:41:32 +00:00
Michael B. Gale
38e701f46e Merge pull request #3419 from github/backport-v3.31.11-19b2f06db 2026-01-23 15:44:23 +00:00
github-actions[bot]
c9e0329cc4 Rebuild 2026-01-23 15:14:24 +00:00
github-actions[bot]
9ffacc75e8 Update version and changelog for v3.31.11 2026-01-23 13:56:12 +00:00
github-actions[bot]
21961f3b6f Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.11-19b2f06db 2026-01-23 13:56:10 +00:00
github-actions[bot]
8233700206 Revert "Rebuild"
This reverts commit 6252d140cd.
2026-01-23 13:56:10 +00:00
github-actions[bot]
23e84a39f0 Revert "Update version and changelog for v3.31.10"
This reverts commit 84cf4b44bb.
2026-01-23 13:56:09 +00:00
Ian Lynagh
4bdb89f480 Merge pull request #3396 from github/backport-v3.31.10-cdefb33c0
Merge releases/v4 into releases/v3
2026-01-12 16:26:37 +00:00
Michael B. Gale
ed629463c0 Set using: node20 for verify-debug-artifact-scan-completed on releases/v3 2026-01-12 15:44:23 +00:00
github-actions[bot]
6252d140cd Rebuild 2026-01-12 15:28:18 +00:00
github-actions[bot]
84cf4b44bb Update version and changelog for v3.31.10 2026-01-12 14:37:46 +00:00
github-actions[bot]
52cebb523a Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.10-cdefb33c0 2026-01-12 14:37:43 +00:00
github-actions[bot]
fc6e643fe1 Revert "Rebuild"
This reverts commit 311b632b9d.
2026-01-12 14:37:43 +00:00
github-actions[bot]
f8ee3fcc9a Revert "Update version and changelog for v3.31.9"
This reverts commit d300581d5e.
2026-01-12 14:37:43 +00:00
Henry Mercer
45c373516f Merge pull request #3373 from github/backport-v3.31.9-5d4e8d1ac
Merge releases/v4 into releases/v3
2025-12-16 19:21:59 +00:00
github-actions[bot]
311b632b9d Rebuild 2025-12-16 18:51:43 +00:00
github-actions[bot]
d300581d5e Update version and changelog for v3.31.9 2025-12-16 18:34:57 +00:00
github-actions[bot]
7348876640 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.9-5d4e8d1ac 2025-12-16 18:34:56 +00:00
github-actions[bot]
4f34645a82 Revert "Rebuild"
This reverts commit 74951318a2.
2025-12-16 18:34:56 +00:00
github-actions[bot]
e7c7a2d323 Revert "Update version and changelog for v3.31.8"
This reverts commit 5676d1f64a.
2025-12-16 18:34:56 +00:00
Óscar San José
f47c8e6a9b Merge pull request #3357 from github/backport-v3.31.8-1b168cd39
Merge releases/v4 into releases/v3
2025-12-12 10:43:49 +01:00
github-actions[bot]
74951318a2 Rebuild 2025-12-12 08:53:47 +00:00
github-actions[bot]
5676d1f64a Update version and changelog for v3.31.8 2025-12-12 08:46:33 +00:00
github-actions[bot]
c1bea80e56 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.8-1b168cd39 2025-12-12 08:46:32 +00:00
github-actions[bot]
2d9c0b97af Revert "Rebuild"
This reverts commit 817dbfb39b.
2025-12-12 08:46:32 +00:00
github-actions[bot]
827017f97b Revert "Update version and changelog for v3.31.7"
This reverts commit 793f7006bb.
2025-12-12 08:46:31 +00:00
Henry Mercer
bffd034ab1 Merge pull request #3346 from github/backport-v3.31.7-cf1bb45a2
Merge releases/v4 into releases/v3
2025-12-09 13:26:37 +00:00
github-actions[bot]
817dbfb39b Rebuild 2025-12-05 20:45:51 +00:00
github-actions[bot]
793f7006bb Update version and changelog for v3.31.7 2025-12-05 17:21:20 +00:00
github-actions[bot]
d2e9832330 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.7-cf1bb45a2 2025-12-05 17:21:19 +00:00
github-actions[bot]
c2e4b7785f Revert "Rebuild"
This reverts commit 89cb79a131.
2025-12-05 17:21:18 +00:00
github-actions[bot]
66d7f51a10 Revert "Update version and changelog for v3.31.6"
This reverts commit dbf6819ebd.
2025-12-05 17:21:18 +00:00
Michael B. Gale
497990dfed Merge pull request #3338 from github/backport-v3.31.6-fe4161a26
Merge releases/v4 into releases/v3
2025-12-01 10:24:24 +00:00
github-actions[bot]
89cb79a131 Rebuild 2025-12-01 09:59:32 +00:00
github-actions[bot]
dbf6819ebd Update version and changelog for v3.31.6 2025-12-01 09:52:51 +00:00
github-actions[bot]
5af51f4048 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.6-fe4161a26 2025-12-01 09:52:49 +00:00
github-actions[bot]
e439418aab Revert "Rebuild"
This reverts commit c12d7c1f2d.
2025-12-01 09:52:49 +00:00
github-actions[bot]
249860e323 Revert "Update version and changelog for v3.31.5"
This reverts commit 2e2a1cf1ef.
2025-12-01 09:52:49 +00:00
Paolo Tranquilli
d3ced5c96c Merge pull request #3324 from github/backport-v3.31.5-fdbfb4d27
Merge releases/v4 into releases/v3
2025-11-24 12:16:57 +01:00
github-actions[bot]
c12d7c1f2d Rebuild 2025-11-24 10:56:57 +00:00
github-actions[bot]
2e2a1cf1ef Update version and changelog for v3.31.5 2025-11-24 09:33:54 +00:00
github-actions[bot]
e2cca77d06 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.5-fdbfb4d27 2025-11-24 09:33:53 +00:00
github-actions[bot]
801a18bea6 Revert "Rebuild"
This reverts commit 9031cd9330.
2025-11-24 09:33:52 +00:00
github-actions[bot]
1c715a714c Revert "Update version and changelog for v3.31.4"
This reverts commit f58938aee2.
2025-11-24 09:33:52 +00:00
Henry Mercer
c3d42c5d08 Merge pull request #3314 from github/backport-v3.31.4-e12f01789
Merge releases/v4 into releases/v3
2025-11-19 10:02:25 +00:00
github-actions[bot]
9031cd9330 Rebuild 2025-11-18 17:06:56 +00:00
github-actions[bot]
f58938aee2 Update version and changelog for v3.31.4 2025-11-18 16:16:32 +00:00
github-actions[bot]
1f1c162805 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.4-e12f01789 2025-11-18 16:16:30 +00:00
github-actions[bot]
7ab96a0e6f Revert "Rebuild"
This reverts commit e5971bdba6.
2025-11-18 16:16:30 +00:00
github-actions[bot]
e3cb86275a Revert "Update version and changelog for v3.31.3"
This reverts commit c5a9d29dc9.
2025-11-18 16:16:29 +00:00
Michael B. Gale
f94c9befff Merge pull request #3295 from github/backport-v3.31.3-014f16e7a
Merge releases/v4 into releases/v3
2025-11-13 22:45:46 +00:00
github-actions[bot]
e5971bdba6 Rebuild 2025-11-13 22:03:22 +00:00
github-actions[bot]
c5a9d29dc9 Update version and changelog for v3.31.3 2025-11-13 21:57:42 +00:00
github-actions[bot]
9f1109665d Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.3-014f16e7a 2025-11-13 21:57:40 +00:00
github-actions[bot]
f8f60f3a2b Revert "Rebuild"
This reverts commit c6eb09db21.
2025-11-13 21:57:40 +00:00
github-actions[bot]
f4d10b9ef7 Revert "Update version and changelog for v3.31.2"
This reverts commit 09db9044dc.
2025-11-13 21:57:39 +00:00
Henry Mercer
5d5cd550d3 Merge pull request #3263 from github/backport-v3.31.2-0499de31b
Merge releases/v4 into releases/v3
2025-10-30 15:01:09 +00:00
github-actions[bot]
c6eb09db21 Rebuild 2025-10-30 14:37:32 +00:00
github-actions[bot]
09db9044dc Update version and changelog for v3.31.2 2025-10-30 14:34:26 +00:00
github-actions[bot]
d3cd47d8d6 Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.2-0499de31b 2025-10-30 14:34:25 +00:00
github-actions[bot]
8e9caa5100 Revert "Rebuild"
This reverts commit c2805e0a04.
2025-10-30 14:34:25 +00:00
github-actions[bot]
23a6333b88 Revert "Update version and changelog for v3.31.1"
This reverts commit c0d3370b54.
2025-10-30 14:34:24 +00:00
Henry Mercer
c503cb4fbb Merge pull request #3254 from github/backport-v3.31.1-5fe9434cd
Merge releases/v4 into releases/v3
2025-10-30 11:00:54 +00:00
github-actions[bot]
c2805e0a04 Rebuild 2025-10-30 10:35:44 +00:00
github-actions[bot]
c0d3370b54 Update version and changelog for v3.31.1 2025-10-30 10:31:02 +00:00
github-actions[bot]
ddd0dc746a Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.1-5fe9434cd 2025-10-30 10:31:01 +00:00
github-actions[bot]
2f607936ce Revert "Rebuild"
This reverts commit 9e3918e481.
2025-10-30 10:31:00 +00:00
github-actions[bot]
37e7dfbaa0 Revert "Update version and changelog for v3.31.0"
This reverts commit 7dd1575dac.
2025-10-30 10:31:00 +00:00
Michael B. Gale
d198d2fabf Merge pull request #3237 from github/backport-v3.31.0-4e94bd11f
Merge releases/v4 into releases/v3
2025-10-24 19:30:34 +01:00
github-actions[bot]
9e3918e481 Rebuild 2025-10-24 17:18:40 +00:00
github-actions[bot]
7dd1575dac Update version and changelog for v3.31.0 2025-10-24 17:11:07 +00:00
github-actions[bot]
28fc48d83c Merge remote-tracking branch 'origin/releases/v4' into backport-v3.31.0-4e94bd11f 2025-10-24 17:11:06 +00:00
github-actions[bot]
12c6008004 Revert "Rebuild"
This reverts commit 5f3f3164ad.
2025-10-24 17:11:05 +00:00
github-actions[bot]
d3019effb0 Revert "Update version and changelog for v3.30.9"
This reverts commit ba42101490.
2025-10-24 17:11:05 +00:00
Henry Mercer
42213152a8 Merge pull request #3216 from github/backport-v3.30.9-16140ae1a
Merge releases/v4 into releases/v3
2025-10-17 17:09:13 +01:00
Henry Mercer
e677e67801 Run setup-codeql on Node 20 for v3 2025-10-17 16:53:18 +01:00
github-actions[bot]
5f3f3164ad Rebuild 2025-10-17 15:34:40 +00:00
github-actions[bot]
ba42101490 Update version and changelog for v3.30.9 2025-10-17 15:24:34 +00:00
github-actions[bot]
f11af5849b Merge remote-tracking branch 'origin/releases/v4' into backport-v3.30.9-16140ae1a 2025-10-17 15:24:33 +00:00
github-actions[bot]
ba5430dc86 Revert "Rebuild"
This reverts commit 948223fe01.
2025-10-17 15:24:33 +00:00
github-actions[bot]
13e883e119 Revert "Update version and changelog for v3.30.8"
This reverts commit a37add20d4.
2025-10-17 15:24:32 +00:00
Michael B. Gale
755f44910c Merge pull request #3201 from github/backport-v3.30.8-2a6736cca
Merge releases/v4 into releases/v3
2025-10-10 18:20:36 +01:00
github-actions[bot]
948223fe01 Rebuild 2025-10-10 16:56:34 +00:00
github-actions[bot]
a37add20d4 Update version and changelog for v3.30.8 2025-10-10 16:50:13 +00:00
github-actions[bot]
ab163cf08b Merge remote-tracking branch 'origin/releases/v4' into backport-v3.30.8-2a6736cca 2025-10-10 16:50:12 +00:00
github-actions[bot]
319796f085 Revert "Rebuild"
This reverts commit c551c50310.
2025-10-10 16:50:12 +00:00
github-actions[bot]
bd1ac56295 Revert "Update version and changelog for v3.30.7"
This reverts commit b264e15259.
2025-10-10 16:50:12 +00:00
Mario Campos
a8d1ac45b9 Merge pull request #3187 from github/backport-v3.30.7-e296a9355
Merge releases/v4 into releases/v3
2025-10-07 10:58:53 -05:00
github-actions[bot]
c551c50310 Rebuild 2025-10-07 15:33:29 +00:00
Mario Campos
01f1a24033 Downgrade action.yml to use Node.js 20 instead of Node.js 24 for v3 2025-10-07 10:29:22 -05:00
github-actions[bot]
b264e15259 Update version and changelog for v3.30.7 2025-10-07 15:23:05 +00:00
75 changed files with 3861 additions and 1581 deletions

View File

@@ -16,5 +16,5 @@ inputs:
Comma separated list of query ids that should NOT be included in this SARIF file.
runs:
using: node24
using: node20
main: index.js

View File

@@ -1,6 +1,6 @@
name: Verify that the best-effort debug artifact scan completed
description: Verifies that the best-effort debug artifact scan completed successfully during tests
runs:
using: node24
using: node20
main: index.js
post: post.js

View File

@@ -1,14 +1,33 @@
# CodeQL Action - Copilot Instructions
The CodeQL Action is used in GitHub Actions workflows to run CodeQL scans using the CodeQL CLI.
## Overview
- The repository contains two TypeScript projects.
- The main TypeScript codebase is in the `src` directory, with accompanying unit tests in `.test.ts` files in the same directory.
- The main codebase is compiled to bundled JavaScript code, which is also contained in the repository in the `lib` directory.
- A secondary TypeScript codebase with scripts that are only used for development purposes or by CI is in the `pr-checks` directory. This codebase is not compiled to bundled JavaScript. It is executed directly with `tsx`, which handles compilation internally.
## Review instructions
- When wording review comments, be helpful and friendly. Assume that the PR author has written the code with the best of intentions. Word your comments constructively as suggestions for improvements. Do not word suggestions as commands.
- If you want to comment on a change that you believe will fail a CI check, do not present the CI failure you expect as a fact. Instead, write that you think a change "may" lead to a failure in CI. Suggest that, if such a failure manifests, the changes you are commenting on may be the place responsible for the failure and are worth looking at.
- If a suggestion you make is suitable for a follow-up, such as a refactoring that doesn't change the behaviour or fixing a typo in a comment, mention that it can be addressed in a later PR rather than blocking this one.
- If a change is a net improvement, for example because it improves on an existing limitation of existing code, do not complain about pre-existing problems that remain. You may comment on them, but you should make it clear that the thing you are commenting on is not new by writing e.g. "Not new in this PR, but [..]" followed by your description of the issue and a suggestion that it could be improved at the same time with e.g. "Consider whether this is worth addressing as part of this PR as well."
## Generated code
The CodeQL Action is written in TypeScript and compiled to JavaScript. Both the TypeScript sources and the **generated** JavaScript code are contained in this repository. The TypeScript sources are contained in the `src` directory and the JavaScript code is contained in the `lib` directory. A GitHub Actions workflow checks that the JavaScript code in `lib` is up-to-date. Therefore, you should not review any changes to the contents of the `lib` folder and it is expected that the JavaScript code in `lib` closely mirrors the TypeScript code it is generated from.
The main codebase of the CodeQL Action is written in TypeScript and compiled to JavaScript. Both the TypeScript sources and the **generated** JavaScript code are contained in this repository. The TypeScript sources are contained in the `src` directory and the JavaScript code is contained in the `lib` directory. A GitHub Actions workflow checks that the JavaScript code in `lib` is up-to-date. Therefore, you should not review any changes to the contents of the `lib` folder and it is expected that the JavaScript code in `lib` closely mirrors the TypeScript code it is generated from. The secondary TypeScript codebase has sources in the `pr-checks` directory, which are executed directly with `tsx` and not compiled to JavaScript in the `lib` folder.
GitHub Actions workflows in the `.github/workflows` directory whose filenames start with two underscores (e.g. `__all-platform-bundle.yml`) are automatically generated using the `pr-checks/sync.sh` script from template files in the `pr-checks/checks` directory. Therefore, you do not need to review files in the `.github/workflows` directory that start with two underscores. However, you should review changes to the `pr-checks` directory as well as workflows in the `.github/workflows` directory that do not start with underscores.
## Release process
Changes that are merged to the `main` branch are not used in production straight away. Instead, changes from `main` must first be released using the release process, which has to be manually triggered by a staff member. Therefore, it is possible for further changes to be made to the code after some changes have been merged to `main` but before they are released. Once the release process automation is started, a series of PRs are automatically generated:
- A release-PR is a PR which matches all of the following patterns:
- PR title starts with the exact prefix: `Merge main into releases/v`
- Equivalent regex: `^Merge main into releases\/v`
- AND head (source) branch matches the update-branch pattern:
@@ -17,5 +36,5 @@ GitHub Actions workflows in the `.github/workflows` directory whose filenames st
- Regex: `^releases\/v` (e.g. `releases/v3`)
- Consider all files in release-PRs to have already been reviewed and do not review them, except for the following two files:
- `CHANGELOG.md`
- `package.json`
- `CHANGELOG.md`
- `package.json`

View File

@@ -56,7 +56,7 @@ jobs:
include:
- os: ubuntu-latest
version: nightly-latest
- os: macos-latest
- os: macos-latest-xlarge
version: nightly-latest
- os: windows-latest
version: nightly-latest

View File

@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Java
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin

View File

@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Java
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin

View File

@@ -80,7 +80,8 @@ jobs:
- id: init
uses: ./../action/init
with:
languages: javascript
# Request multiple languages so this check uses the combined bundle.
languages: javascript,python
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:

164
.github/workflows/__per-language-bundle-validation.yml generated vendored Normal file
View File

@@ -0,0 +1,164 @@
# Warning: This file is generated automatically, and should not be modified.
# Instead, please modify the template in the pr-checks directory and run:
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Per-language bundles
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request: {}
merge_group:
types:
- checks_requested
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs: {}
workflow_call:
inputs: {}
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
group: per-language-bundle-validation-${{github.ref}}
jobs:
per-language-bundle-validation:
strategy:
fail-fast: false
matrix:
include:
- language: actions
os: ubuntu-latest
version: nightly-latest
expected-extractors: actions javascript
- language: cpp
os: ubuntu-latest
version: nightly-latest
build-mode: manual
build-command: gcc -o main main.c
- language: csharp
os: ubuntu-latest
version: nightly-latest
build-mode: none
- language: go
os: ubuntu-latest
version: nightly-latest
build-mode: autobuild
- language: java
os: ubuntu-latest
version: nightly-latest
build-mode: none
- language: javascript
os: ubuntu-latest
version: nightly-latest
- language: python
os: ubuntu-latest
version: nightly-latest
- language: ruby
os: ubuntu-latest
version: nightly-latest
- language: rust
os: ubuntu-latest
version: nightly-latest
- language: swift
os: macos-latest-xlarge
version: nightly-latest
build-mode: autobuild
name: Per-language bundles
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- uses: ./../action/init
id: init
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix['build-mode'] }}
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check that the bundle contains only the expected extractors
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
LANGUAGE: ${{ matrix.language }}
EXPECTED_EXTRACTORS: ${{ matrix['expected-extractors'] || matrix.language }}
run: |
extractors="$("$CODEQL_PATH" resolve languages --format=json | jq -r 'keys[]')"
echo "Extractors in the bundle:"
echo "$extractors"
echo "Expected: $EXPECTED_EXTRACTORS"
for expected in $EXPECTED_EXTRACTORS; do
if ! echo "$extractors" | grep -qx "$expected"; then
echo "::error::The ${LANGUAGE} bundle does not contain the ${expected} extractor."
exit 1
fi
done
# If the bundle contained extractors beyond those the language needs, then it would not
# have been trimmed, and this job would be silently validating the combined bundle.
for other in actions cpp csharp go java javascript python ruby rust swift; do
if echo "$EXPECTED_EXTRACTORS" | grep -qw "$other"; then
continue
fi
if echo "$extractors" | grep -qx "$other"; then
echo "::error::The ${LANGUAGE} bundle also contains the ${other} extractor, so it is not trimmed."
exit 1
fi
done
- name: Check that the bundle was not added to the toolcache
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
# A bundle that is missing most of its extractors must never be left in the toolcache,
# where a later job analyzing a different language could pick it up. The runner image
# ships with its own CodeQL in the toolcache, so check where this bundle was extracted to
# rather than whether the toolcache contains CodeQL at all.
echo "CodeQL is at $CODEQL_PATH"
if [[ "$CODEQL_PATH" == "$RUNNER_TOOL_CACHE"/* ]]; then
echo "::error::The per-language bundle was added to the toolcache at $CODEQL_PATH."
exit 1
fi
if [[ "$CODEQL_PATH" != "$RUNNER_TEMP"/* ]]; then
echo "::error::Expected the per-language bundle to be extracted under $RUNNER_TEMP, but found it at $CODEQL_PATH."
exit 1
fi
- name: Build code
if: matrix['build-command']
run: ${{ matrix['build-command'] }}
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check that a database was created for the language
env:
DB_LOCATIONS: ${{ steps.analysis.outputs.db-locations }}
LANGUAGE: ${{ matrix.language }}
run: |
database="$(echo "$DB_LOCATIONS" | jq -r --arg lang "$LANGUAGE" '.[$lang] // empty')"
if [ -z "$database" ] || [ ! -d "$database" ]; then
echo "::error::No CodeQL database was created for ${LANGUAGE}."
echo "Databases: $DB_LOCATIONS"
exit 1
fi
echo "Created a ${LANGUAGE} database at ${database}."
env:
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true
CODEQL_ACTION_TEST_MODE: true

View File

@@ -54,7 +54,7 @@ jobs:
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
uses: ruby/setup-ruby@984c0c890880bbf811283d6f09c4607c62d210a4 # v1.323.0
with:
ruby-version: 2.6
- name: Install Code Scanning integration

View File

@@ -54,11 +54,11 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-latest
- os: macos-latest-xlarge
version: linked
- os: macos-latest
- os: macos-latest-xlarge
version: default
- os: macos-latest
- os: macos-latest-xlarge
version: nightly-latest
name: Swift analysis using a custom build command
if: github.triggering_actor != 'dependabot[bot]'

View File

@@ -75,7 +75,8 @@ jobs:
uses: ./../action/.github/actions/check-codescanning-config
with:
expected-config-file-contents: "{}"
languages: javascript
# Request multiple languages so later checks can reuse the combined bundle.
languages: javascript,python
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Packs from input

View File

@@ -45,7 +45,7 @@ jobs:
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: "npm"
- name: Install dependencies
run: |
@@ -77,33 +77,6 @@ jobs:
sarif_file: eslint.sarif
category: eslint
changetool-tests:
name: changetool unit tests
permissions:
contents: read
runs-on: ubuntu-slim
timeout-minutes: 10
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
group: pr-checks-changetool-tests-${{ github.ref }}-${{ github.event_name }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run changetool unit tests
run: npm --workspace changetool test
# These checks do not need to be run as part of the same matrix that we use for the `unit-tests`
# job.
other-checks:
@@ -126,7 +99,7 @@ jobs:
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: 'npm'
cache: "npm"
- name: Install dependencies
id: install-deps
@@ -141,6 +114,10 @@ jobs:
working-directory: pr-checks
run: npx tsx --test
- name: Run `pr-checks/changenotes.mts` to ensure that all unreleased change notes are valid
if: ${{ !cancelled() && steps.install-deps.outcome == 'success' }}
run: npx tsx pr-checks/changenotes.mts validate
- name: Verify all Actions use the same Node version
id: head-version
run: |
@@ -190,14 +167,14 @@ jobs:
path: ${{ runner.temp }}/repo-size/
if-no-files-found: error
- name: 'Backport: Check out base ref'
- name: "Backport: Check out base ref"
id: checkout-base
if: ${{ startsWith(github.head_ref, 'backport-') }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.base_ref }}
- name: 'Backport: Verify Node versions unchanged'
- name: "Backport: Verify Node versions unchanged"
if: steps.checkout-base.outcome == 'success'
env:
HEAD_VERSION: ${{ steps.head-version.outputs.node_version }}

View File

@@ -2,87 +2,96 @@
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
## [UNRELEASED]
## 3.38.2 - 24 Sept 2026
- Update default CodeQL bundle version to [2.27.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.1). [#4160](https://github.com/github/codeql-action/pull/4160)
## 3.38.1 - 18 Sept 2026
- The CodeQL Action now has experimental support for CodeQL releases for which per-language bundles are available. Per-language bundles support analysis for a single language and are therefore smaller than the combined bundles that allow analysis for all supported languages. As a result, per-language bundles take up less space on disk and are faster to download. We expect to roll this change out to everyone in the coming weeks. [#4146](https://github.com/github/codeql-action/pull/4146)
## 3.38.0 - 09 Sept 2026
- On GitHub-hosted runners, the CodeQL Action now deletes unused CodeQL bundles from the toolcache before downloading a different bundle, which frees up disk space for the analysis. We expect to roll this change out to everyone in September. [#4124](https://github.com/github/codeql-action/pull/4124)
- The CodeQL Action now supports CodeQL releases that are compatible with Linux Arm64 and downloads the native `linux-arm64` CodeQL bundle when available. [#4072](https://github.com/github/codeql-action/pull/4072)
- Update default CodeQL bundle version to [2.27.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.0). [#4129](https://github.com/github/codeql-action/pull/4129)
## 4.37.9 - 26 Aug 2026
## 3.37.9 - 26 Aug 2026
- Update default CodeQL bundle version to [2.26.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.4). [#4106](https://github.com/github/codeql-action/pull/4106)
## 4.37.8 - 21 Aug 2026
## 3.37.8 - 21 Aug 2026
No user facing changes.
## 4.37.7 - 13 Aug 2026
## 3.37.7 - 13 Aug 2026
- Update default CodeQL bundle version to [2.26.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.3). [#4085](https://github.com/github/codeql-action/pull/4085)
## 4.37.6 - 04 Aug 2026
## 3.37.6 - 04 Aug 2026
- Changed the default filepath for the new remote file address format that was introduced in CodeQL Action 4.37.0 / 3.37.0 to `.github/codeql-config.yml` to align it with the suggested path that is used elsewhere. [#4070](https://github.com/github/codeql-action/pull/4070)
## 4.37.5 - 03 Aug 2026
## 3.37.5 - 03 Aug 2026
- Fixed a bug where a network error while streaming the download of the CodeQL bundle could terminate the `init` Action instead of falling back to downloading the bundle before extracting it. [#4061](https://github.com/github/codeql-action/pull/4061)
## 4.37.4 - 29 Jul 2026
## 3.37.4 - 29 Jul 2026
- This version of the CodeQL Action adds support for the `tools` input for the `codeql-action/init` step to be specified using a `github-codeql-tools` [repository property](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature will gradually be rolled out following the release of this version. Once rolled out, this allows for the CodeQL CLI version that is used in GitHub-managed workflows, such as Default Setup, to be set to a custom value. For example, customers who run into issues with rate limits when a new CodeQL CLI version is released can set the value to `toolcache` to always use the CodeQL CLI version that is available in the runner toolcache. For Advanced Setup workflows, the value provided for `tools` in the workflow definition always takes precedence unless the value of the repository property starts with `!`. [#4037](https://github.com/github/codeql-action/pull/4037)
- Update default CodeQL bundle version to [2.26.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.2). [#4051](https://github.com/github/codeql-action/pull/4051)
## 4.37.3 - 22 Jul 2026
## 3.37.3 - 22 Jul 2026
No user facing changes.
## 4.37.2 - 21 Jul 2026
## 3.37.2 - 21 Jul 2026
- The new address format for the `config-file` input that was introduced in CodeQL Action 4.37.0 is now enabled by default. In addition to the format described there, the `remote=` prefix can now be used to explicitly indicate that the input refers to a remote file. All previous input formats continue to be accepted as well. [#4023](https://github.com/github/codeql-action/pull/4023)
- The CodeQL Action can now make use of [configured private registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) in Default Setup to retrieve CodeQL configuration files from remote repositories that require authentication. This will allow customers to store their CodeQL configuration in a single repository that can then be referenced by Default Setup workflows in other repositories. We expect to roll this and other, related changes out to everyone in July. [#4007](https://github.com/github/codeql-action/pull/4007)
## 4.37.1 - 16 Jul 2026
## 3.37.1 - 16 Jul 2026
- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.20.6 and earlier. These versions of CodeQL were discontinued on 1 July 2026 alongside GitHub Enterprise Server 3.16, and will be unsupported by the next minor release of the CodeQL Action. [#3956](https://github.com/github/codeql-action/pull/3956)
- Update default CodeQL bundle version to [2.26.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.1). [#4019](https://github.com/github/codeql-action/pull/4019)
## 4.37.0 - 08 Jul 2026
## 3.37.0 - 08 Jul 2026
- Update default CodeQL bundle version to [2.26.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.0). [#3995](https://github.com/github/codeql-action/pull/3995)
- In addition to the existing input format, the `config-file` input for the `codeql-action/init` step will soon support a new `[owner/]repo[@ref][:path]` format. All components except the repository name are optional. If omitted, `owner` defaults to the same owner as the repository the analysis is running for, `ref` to `main`, and `path` to `.github/codeql-action.yaml`. Support for this format ships in this version of the CodeQL Action, but will only be enabled over the coming weeks. [#3973](https://github.com/github/codeql-action/pull/3973)
## 4.36.3 - 01 Jul 2026
## 3.36.3 - 01 Jul 2026
No user facing changes.
## 4.36.2 - 04 Jun 2026
## 3.36.2 - 04 Jun 2026
- Cache CodeQL CLI version information across Actions steps. [#3943](https://github.com/github/codeql-action/pull/3943)
- Reduce requests while waiting for analysis processing by using exponential backoff when polling SARIF processing status. [#3937](https://github.com/github/codeql-action/pull/3937)
- Update default CodeQL bundle version to [2.25.6](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.6). [#3948](https://github.com/github/codeql-action/pull/3948)
## 4.36.1 - 02 Jun 2026
## 3.36.1 - 02 Jun 2026
No user facing changes.
## 4.36.0 - 22 May 2026
## 3.36.0 - 22 May 2026
- _Breaking change_: Bump the minimum required CodeQL bundle version to 2.19.4. [#3894](https://github.com/github/codeql-action/pull/3894)
- Add support for SHA-256 Git object IDs. [#3893](https://github.com/github/codeql-action/pull/3893)
- Update default CodeQL bundle version to [2.25.5](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.5). [#3926](https://github.com/github/codeql-action/pull/3926)
## 4.35.5 - 15 May 2026
## 3.35.5 - 15 May 2026
- We have improved how the JavaScript bundles for the CodeQL Action are generated to avoid duplication across bundles and reduce the size of the repository by around 70%. This should have no effect on the runtime behaviour of the CodeQL Action. [#3899](https://github.com/github/codeql-action/pull/3899)
- For performance and accuracy reasons, [improved incremental analysis](https://github.com/github/roadmap/issues/1158) will now only be enabled on a pull request when diff-informed analysis is also enabled for that run. If diff-informed analysis is unavailable (for example, because the PR diff ranges could not be computed), the action will fall back to a full analysis. [#3791](https://github.com/github/codeql-action/pull/3791)
- If multiple inputs are provided for the GitHub-internal `analysis-kinds` input, only `code-scanning` will be enabled. The `analysis-kinds` input is experimental, for GitHub-internal use only, and may change without notice at any time. [#3892](https://github.com/github/codeql-action/pull/3892)
- Added an experimental change which, when running a Code Scanning analysis for a PR with [improved incremental analysis](https://github.com/github/roadmap/issues/1158) enabled, prefers CodeQL CLI versions that have a cached overlay-base database for the configured languages. This speeds up analysis for a repository when there is not yet a cached overlay-base database for the latest CLI version. We expect to roll this change out to everyone in May. [#3880](https://github.com/github/codeql-action/pull/3880)
## 4.35.4 - 07 May 2026
## 3.35.4 - 07 May 2026
- Update default CodeQL bundle version to [2.25.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.4). [#3881](https://github.com/github/codeql-action/pull/3881)
## 4.35.3 - 01 May 2026
## 3.35.3 - 01 May 2026
- _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.19.3 and earlier. These versions of CodeQL were discontinued on 9 April 2026 alongside GitHub Enterprise Server 3.15, and will be unsupported by the next minor release of the CodeQL Action. [#3837](https://github.com/github/codeql-action/pull/3837)
- Configurations for private registries that use Cloudsmith or GCP OIDC are now accepted. [#3850](https://github.com/github/codeql-action/pull/3850)
@@ -90,7 +99,7 @@ No user facing changes.
- Fixed a bug where two diagnostics produced within the same millisecond could overwrite each other on disk, causing one of them to be lost. [#3852](https://github.com/github/codeql-action/pull/3852)
- Update default CodeQL bundle version to [2.25.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.3). [#3865](https://github.com/github/codeql-action/pull/3865)
## 4.35.2 - 15 Apr 2026
## 3.35.2 - 15 Apr 2026
- The undocumented TRAP cache cleanup feature that could be enabled using the `CODEQL_ACTION_CLEANUP_TRAP_CACHES` environment variable is deprecated and will be removed in May 2026. If you are affected by this, we recommend disabling TRAP caching by passing the `trap-caching: false` input to the `init` Action. [#3795](https://github.com/github/codeql-action/pull/3795)
- The Git version 2.36.0 requirement for improved incremental analysis now only applies to repositories that contain submodules. [#3789](https://github.com/github/codeql-action/pull/3789)
@@ -98,26 +107,26 @@ No user facing changes.
- Fixed a bug in the validation of OIDC configurations for private registries that was added in CodeQL Action 4.33.0 / 3.33.0. [#3807](https://github.com/github/codeql-action/pull/3807)
- Update default CodeQL bundle version to [2.25.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.2). [#3823](https://github.com/github/codeql-action/pull/3823)
## 4.35.1 - 27 Mar 2026
## 3.35.1 - 27 Mar 2026
- Fix incorrect minimum required Git version for [improved incremental analysis](https://github.com/github/roadmap/issues/1158): it should have been 2.36.0, not 2.11.0. [#3781](https://github.com/github/codeql-action/pull/3781)
## 4.35.0 - 27 Mar 2026
## 3.35.0 - 27 Mar 2026
- Reduced the minimum Git version required for [improved incremental analysis](https://github.com/github/roadmap/issues/1158) from 2.38.0 to 2.11.0. [#3767](https://github.com/github/codeql-action/pull/3767)
- Update default CodeQL bundle version to [2.25.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.1). [#3773](https://github.com/github/codeql-action/pull/3773)
## 4.34.1 - 20 Mar 2026
## 3.34.1 - 20 Mar 2026
- Downgrade default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3) due to issues with a small percentage of Actions and JavaScript analyses. [#3762](https://github.com/github/codeql-action/pull/3762)
## 4.34.0 - 20 Mar 2026
## 3.34.0 - 20 Mar 2026
- Added an experimental change which disables TRAP caching when [improved incremental analysis](https://github.com/github/roadmap/issues/1158) is enabled, since improved incremental analysis supersedes TRAP caching. This will improve performance and reduce Actions cache usage. We expect to roll this change out to everyone in March. [#3569](https://github.com/github/codeql-action/pull/3569)
- We are rolling out improved incremental analysis to C/C++ analyses that use build mode `none`. We expect this rollout to be complete by the end of April 2026. [#3584](https://github.com/github/codeql-action/pull/3584)
- Update default CodeQL bundle version to [2.25.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.25.0). [#3585](https://github.com/github/codeql-action/pull/3585)
## 4.33.0 - 16 Mar 2026
## 3.33.0 - 16 Mar 2026
- Upcoming change: Starting April 2026, the CodeQL Action will skip collecting file coverage information on pull requests to improve analysis performance. File coverage information will still be computed on non-PR analyses. Pull request analyses will log a warning about this upcoming change. [#3562](https://github.com/github/codeql-action/pull/3562)
@@ -131,11 +140,11 @@ No user facing changes.
- Fixed the retry mechanism for database uploads. Previously this would fail with the error "Response body object should not be disturbed or locked". [#3564](https://github.com/github/codeql-action/pull/3564)
- A warning is now emitted if the CodeQL Action detects a repository property whose name suggests that it relates to the CodeQL Action, but which is not one of the properties recognised by the current version of the CodeQL Action. [#3570](https://github.com/github/codeql-action/pull/3570)
## 4.32.6 - 05 Mar 2026
## 3.32.6 - 05 Mar 2026
- Update default CodeQL bundle version to [2.24.3](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.3). [#3548](https://github.com/github/codeql-action/pull/3548)
## 4.32.5 - 02 Mar 2026
## 3.32.5 - 02 Mar 2026
- Repositories owned by an organization can now set up the `github-codeql-disable-overlay` custom repository property to disable [improved incremental analysis for CodeQL](https://github.com/github/roadmap/issues/1158). First, create a custom repository property with the name `github-codeql-disable-overlay` and the type "True/false" in the organization's settings. Then in the repository's settings, set this property to `true` to disable improved incremental analysis. For more information, see [Managing custom properties for repositories in your organization](https://docs.github.com/en/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization). This feature is not yet available on GitHub Enterprise Server. [#3507](https://github.com/github/codeql-action/pull/3507)
- Added an experimental change so that when [improved incremental analysis](https://github.com/github/roadmap/issues/1158) fails on a runner — potentially due to insufficient disk space — the failure is recorded in the Actions cache so that subsequent runs will automatically skip improved incremental analysis until something changes (e.g. a larger runner is provisioned or a new CodeQL version is released). We expect to roll this change out to everyone in March. [#3487](https://github.com/github/codeql-action/pull/3487)
@@ -145,7 +154,7 @@ No user facing changes.
- Added an experimental change which allows the `start-proxy` action to resolve the CodeQL CLI version from feature flags instead of using the linked CLI bundle version. We expect to roll this change out to everyone in March. [#3512](https://github.com/github/codeql-action/pull/3512)
- The previously experimental changes from versions 4.32.3, 4.32.4, 3.32.3 and 3.32.4 are now enabled by default. [#3503](https://github.com/github/codeql-action/pull/3503), [#3504](https://github.com/github/codeql-action/pull/3504)
## 4.32.4 - 20 Feb 2026
## 3.32.4 - 20 Feb 2026
- Update default CodeQL bundle version to [2.24.2](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.2). [#3493](https://github.com/github/codeql-action/pull/3493)
- Added an experimental change which improves how certificates are generated for the authentication proxy that is used by the CodeQL Action in Default Setup when [private package registries are configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries). This is expected to generate more widely compatible certificates and should have no impact on analyses which are working correctly already. We expect to roll this change out to everyone in February. [#3473](https://github.com/github/codeql-action/pull/3473)
@@ -153,89 +162,89 @@ No user facing changes.
- Added a setting which allows the CodeQL Action to enable network debugging for Java programs. This will help GitHub staff support customers with troubleshooting issues in GitHub-managed CodeQL workflows, such as Default Setup. This setting can only be enabled by GitHub staff. [#3485](https://github.com/github/codeql-action/pull/3485)
- Added a setting which enables GitHub-managed workflows, such as Default Setup, to use a [nightly CodeQL CLI release](https://github.com/dsp-testing/codeql-cli-nightlies) instead of the latest, stable release that is used by default. This will help GitHub staff support customers whose analyses for a given repository or organization require early access to a change in an upcoming CodeQL CLI release. This setting can only be enabled by GitHub staff. [#3484](https://github.com/github/codeql-action/pull/3484)
## 4.32.3 - 13 Feb 2026
## 3.32.3 - 13 Feb 2026
- Added experimental support for testing connections to [private package registries](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries). This feature is not currently enabled for any analysis. In the future, it may be enabled by default for Default Setup. [#3466](https://github.com/github/codeql-action/pull/3466)
## 4.32.2 - 05 Feb 2026
## 3.32.2 - 05 Feb 2026
- Update default CodeQL bundle version to [2.24.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.1). [#3460](https://github.com/github/codeql-action/pull/3460)
## 4.32.1 - 02 Feb 2026
## 3.32.1 - 02 Feb 2026
- A warning is now shown in Default Setup workflow logs if a [private package registry is configured](https://docs.github.com/en/code-security/how-tos/secure-at-scale/configure-organization-security/manage-usage-and-access/giving-org-access-private-registries) using a GitHub Personal Access Token (PAT), but no username is configured. [#3422](https://github.com/github/codeql-action/pull/3422)
- Fixed a bug which caused the CodeQL Action to fail when repository properties cannot successfully be retrieved. [#3421](https://github.com/github/codeql-action/pull/3421)
## 4.32.0 - 26 Jan 2026
## 3.32.0 - 26 Jan 2026
- Update default CodeQL bundle version to [2.24.0](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.24.0). [#3425](https://github.com/github/codeql-action/pull/3425)
## 4.31.11 - 23 Jan 2026
## 3.31.11 - 23 Jan 2026
- When running a Default Setup workflow with [Actions debugging enabled](https://docs.github.com/en/actions/how-tos/monitor-workflows/enable-debug-logging), the CodeQL Action will now use more unique names when uploading logs from the Dependabot authentication proxy as workflow artifacts. This ensures that the artifact names do not clash between multiple jobs in a build matrix. [#3409](https://github.com/github/codeql-action/pull/3409)
- Improved error handling throughout the CodeQL Action. [#3415](https://github.com/github/codeql-action/pull/3415)
- Added experimental support for automatically excluding [generated files](https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github) from the analysis. This feature is not currently enabled for any analysis. In the future, it may be enabled by default for some GitHub-managed analyses. [#3318](https://github.com/github/codeql-action/pull/3318)
- The changelog extracts that are included with releases of the CodeQL Action are now shorter to avoid duplicated information from appearing in Dependabot PRs. [#3403](https://github.com/github/codeql-action/pull/3403)
## 4.31.10 - 12 Jan 2026
## 3.31.10 - 12 Jan 2026
- Update default CodeQL bundle version to 2.23.9. [#3393](https://github.com/github/codeql-action/pull/3393)
## 4.31.9 - 16 Dec 2025
## 3.31.9 - 16 Dec 2025
No user facing changes.
## 4.31.8 - 11 Dec 2025
## 3.31.8 - 11 Dec 2025
- Update default CodeQL bundle version to 2.23.8. [#3354](https://github.com/github/codeql-action/pull/3354)
## 4.31.7 - 05 Dec 2025
## 3.31.7 - 05 Dec 2025
- Update default CodeQL bundle version to 2.23.7. [#3343](https://github.com/github/codeql-action/pull/3343)
## 4.31.6 - 01 Dec 2025
## 3.31.6 - 01 Dec 2025
No user facing changes.
## 4.31.5 - 24 Nov 2025
## 3.31.5 - 24 Nov 2025
- Update default CodeQL bundle version to 2.23.6. [#3321](https://github.com/github/codeql-action/pull/3321)
## 4.31.4 - 18 Nov 2025
## 3.31.4 - 18 Nov 2025
No user facing changes.
## 4.31.3 - 13 Nov 2025
## 3.31.3 - 13 Nov 2025
- CodeQL Action v3 will be deprecated in December 2026. The Action now logs a warning for customers who are running v3 but could be running v4. For more information, see [Upcoming deprecation of CodeQL Action v3](https://github.blog/changelog/2025-10-28-upcoming-deprecation-of-codeql-action-v3/).
- Update default CodeQL bundle version to 2.23.5. [#3288](https://github.com/github/codeql-action/pull/3288)
## 4.31.2 - 30 Oct 2025
## 3.31.2 - 30 Oct 2025
No user facing changes.
## 4.31.1 - 30 Oct 2025
## 3.31.1 - 30 Oct 2025
- The `add-snippets` input has been removed from the `analyze` action. This input has been deprecated since CodeQL Action 3.26.4 in August 2024 when this removal was announced.
## 4.31.0 - 24 Oct 2025
## 3.31.0 - 24 Oct 2025
- Bump minimum CodeQL bundle version to 2.17.6. [#3223](https://github.com/github/codeql-action/pull/3223)
- When SARIF files are uploaded by the `analyze` or `upload-sarif` actions, the CodeQL Action automatically performs post-processing steps to prepare the data for the upload. Previously, these post-processing steps were only performed before an upload took place. We are now changing this so that the post-processing steps will always be performed, even when the SARIF files are not uploaded. This does not change anything for the `upload-sarif` action. For `analyze`, this may affect Advanced Setup for CodeQL users who specify a value other than `always` for the `upload` input. [#3222](https://github.com/github/codeql-action/pull/3222)
## 4.30.9 - 17 Oct 2025
## 3.30.9 - 17 Oct 2025
- Update default CodeQL bundle version to 2.23.3. [#3205](https://github.com/github/codeql-action/pull/3205)
- Experimental: A new `setup-codeql` action has been added which is similar to `init`, except it only installs the CodeQL CLI and does not initialize a database. Do not use this in production as it is part of an internal experiment and subject to change at any time. [#3204](https://github.com/github/codeql-action/pull/3204)
## 4.30.8 - 10 Oct 2025
## 3.30.8 - 10 Oct 2025
No user facing changes.
## 4.30.7 - 06 Oct 2025
## 3.30.7 - 06 Oct 2025
- [v4+ only] The CodeQL Action now runs on Node.js v24. [#3169](https://github.com/github/codeql-action/pull/3169)
No user facing changes.
## 3.30.6 - 02 Oct 2025
- Update default CodeQL bundle version to 2.23.2. [#3168](https://github.com/github/codeql-action/pull/3168)

View File

@@ -94,6 +94,6 @@ outputs:
sarif-id:
description: The ID of the uploaded SARIF file.
runs:
using: node24
using: node20
main: "../lib/analyze-entry.js"
post: "../lib/analyze-post-entry.js"

View File

@@ -15,5 +15,5 @@ inputs:
$GITHUB_WORKSPACE as its working directory.
required: false
runs:
using: node24
using: node20
main: '../lib/autobuild-entry.js'

View File

@@ -158,7 +158,7 @@ export default [
},
},
{
files: ["**/*.ts", "**/*.js"],
files: ["**/*.ts", "**/*.js", "**/*.mts"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
@@ -180,7 +180,7 @@ export default [
},
},
{
files: ["pr-checks/**/*.ts"],
files: ["pr-checks/**/*.ts", "pr-checks/**/*.mts"],
languageOptions: {
parserOptions: {
@@ -209,18 +209,4 @@ export default [
],
},
},
{
files: ["scripts/changetool/**/*.ts"],
languageOptions: {
parserOptions: {
project: "./scripts/changetool/tsconfig.json",
},
},
rules: {
"no-console": "off",
"import/extensions": "off",
},
},
];

View File

@@ -177,6 +177,6 @@ outputs:
codeql-version:
description: The version of the CodeQL binary used for analysis
runs:
using: node24
using: node20
main: '../lib/init-entry.js'
post: '../lib/init-post-entry.js'

View File

@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.26.4",
"cliVersion": "2.26.4",
"priorBundleVersion": "codeql-bundle-v2.26.3",
"priorCliVersion": "2.26.3"
"bundleVersion": "codeql-bundle-v2.27.1",
"cliVersion": "2.27.1",
"priorBundleVersion": "codeql-bundle-v2.27.0",
"priorCliVersion": "2.27.0"
}

924
lib/entry-points.js generated

File diff suppressed because it is too large Load Diff

816
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "4.37.10",
"version": "3.38.2",
"private": true,
"description": "CodeQL action",
"scripts": {
@@ -17,8 +17,7 @@
},
"license": "MIT",
"workspaces": [
"pr-checks",
"scripts/changetool"
"pr-checks"
],
"dependencies": {
"@actions/artifact": "^5.0.3",
@@ -31,7 +30,7 @@
"@actions/http-client": "^3.0.0",
"@actions/io": "^2.0.0",
"@actions/tool-cache": "^3.0.1",
"@octokit/core": "^7.0.7",
"@octokit/core": "^7.0.8",
"@octokit/plugin-paginate-rest": "^15.0.0",
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
"@octokit/plugin-retry": "^8.1.1",
@@ -40,7 +39,7 @@
"follow-redirects": "^1.16.0",
"get-folder-size": "^5.0.0",
"https-proxy-agent": "^7.0.6",
"js-yaml": "^5.4.0",
"js-yaml": "^5.4.2",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.0",
@@ -50,9 +49,9 @@
},
"devDependencies": {
"@ava/typescript": "6.0.0",
"@eslint/compat": "^2.1.0",
"@eslint/compat": "^2.1.1",
"@microsoft/eslint-formatter-sarif": "^3.1.0",
"@octokit/types": "^17.0.0",
"@octokit/types": "^18.0.0",
"@types/archiver": "^8.0.0",
"@types/follow-redirects": "^1.14.4",
"@types/js-yaml": "^4.0.9",
@@ -67,14 +66,14 @@
"eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-github": "^6.1.2",
"eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jsdoc": "^64.2.1",
"eslint-plugin-jsdoc": "^64.5.2",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^13.0.6",
"globals": "^17.11.0",
"globals": "^17.12.0",
"nock": "^14.0.17",
"sinon": "^22.1.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.68.0"
"typescript-eslint": "^8.70.0"
},
"overrides": {
"@actions/tool-cache": {

View File

@@ -112,7 +112,7 @@ ${NO_CHANGES_STR}`;
describe("updateChangelog", async () => {
await it("removes `NO_CHANGES_STR` if present in [UNRELEASED] section", async () => {
const result = updateChangelog(EMPTY_CHANGELOG, "");
assert.ok(!result.includes(NO_CHANGES_STR.trim()));
assert.ok(!result.includes(NO_CHANGES_STR));
});
await it("doesn't remove `NO_CHANGES_STR` if present in versioned section", async () => {
@@ -120,7 +120,7 @@ describe("updateChangelog", async () => {
EMPTY_CHANGELOG.replace(UNRELEASED_PLACEHOLDER, "1.2.3"),
"",
);
assert.ok(result.includes(NO_CHANGES_STR.trim()));
assert.ok(result.includes(NO_CHANGES_STR));
});
await it("throws if there are no sections", async () => {

View File

@@ -9,17 +9,46 @@ import * as fs from "node:fs";
import { describe, it } from "node:test";
import {
addBodyLinesToUnreleasedSection,
ChangelogSection,
EMPTY_CHANGELOG,
getHeader,
getReleaseDateString,
NO_CHANGES_STR,
parseChangelog,
processChangelogForBackports,
renderChangelog,
setVersionAndDate,
UNRELEASED_PLACEHOLDER,
} from "./changelog";
import { CHANGELOG_FILE } from "./config";
const testDate = new Date(2026, 7, 14);
describe("getHeader", async () => {
function Section(headerLine: string): ChangelogSection {
return {
headerLine,
bodyLines: [],
};
}
await it("returns non-headers unchanged", () => {
assert.equal("foo", getHeader(Section("foo")));
assert.equal("- bar", getHeader(Section("- bar")));
});
await it("strips octothorpes", async () => {
assert.equal("foo", getHeader(Section("# foo")));
assert.equal("foo", getHeader(Section("## foo")));
assert.equal("foo", getHeader(Section("### foo")));
assert.equal("foo", getHeader(Section("#### foo")));
assert.equal("foo", getHeader(Section("##### foo")));
assert.equal("foo", getHeader(Section("###### foo")));
});
await it("strips whitespace", async () => {
assert.equal("foo", getHeader(Section("# foo ")));
});
});
describe("getReleaseDateString", async () => {
await it("formats dates as expected", async () => {
assert.equal(getReleaseDateString(testDate), "14 Aug 2026");
@@ -70,3 +99,73 @@ describe("processChangelogForBackports", async () => {
assert.deepEqual(result.split("\n"), testChangelogResult.split("\n"));
});
});
describe("addBodyLinesToUnreleasedSection", async () => {
function newChangelogWithSections(sections: ChangelogSection[]) {
return {
preamble: [],
sections,
};
}
await it("throws error if '[UNRELEASED]' section is not first", async () => {
const invalidChangelog = newChangelogWithSections([
{
headerLine: "## Release 1.0.0",
bodyLines: [],
},
{
headerLine: `## ${UNRELEASED_PLACEHOLDER}`,
bodyLines: [],
},
]);
assert.throws(() =>
addBodyLinesToUnreleasedSection(invalidChangelog, ["foo"]),
);
});
await it("overwrites 'No user facing changes.'", async () => {
const changelog = newChangelogWithSections([
{
headerLine: `## ${UNRELEASED_PLACEHOLDER}`,
bodyLines: ["", NO_CHANGES_STR, ""],
},
]);
addBodyLinesToUnreleasedSection(changelog, ["- foo"]);
assert.equal(changelog.sections[0].bodyLines.length, 3);
assert.deepEqual(changelog.sections[0].bodyLines, ["", "- foo", ""]);
});
await it("does nothing if lines is empty", async () => {
const changelog = newChangelogWithSections([
{
headerLine: `## ${UNRELEASED_PLACEHOLDER}`,
bodyLines: ["", NO_CHANGES_STR, ""],
},
]);
const changelogClone = structuredClone(changelog);
addBodyLinesToUnreleasedSection(changelog, []);
assert.deepEqual(changelog, changelogClone);
});
await it("inserts a line", async () => {
const changelog = newChangelogWithSections([
{
headerLine: `## ${UNRELEASED_PLACEHOLDER}`,
bodyLines: ["", "- Added a new dependency.", ""],
},
]);
const lineToInsert = "- foo";
addBodyLinesToUnreleasedSection(changelog, [lineToInsert]);
assert.equal(changelog.sections[0].bodyLines.length, 4);
assert.ok(
changelog.sections[0].bodyLines.some((line) => line === lineToInsert),
);
});
});

View File

@@ -6,14 +6,16 @@ import { CHANGELOG_FILE, DryRunOption } from "./config";
export const UNRELEASED_PLACEHOLDER = "[UNRELEASED]";
/** The default contents for a section in the changelog. */
export const NO_CHANGES_STR = "No user facing changes.\n\n";
export const NO_CHANGES_STR = "No user facing changes.";
/** Placeholder changelog content for a new release. */
export const EMPTY_CHANGELOG = `# CodeQL Action Changelog
## ${UNRELEASED_PLACEHOLDER}
${NO_CHANGES_STR}`;
${NO_CHANGES_STR}
`;
/**
* Represents sections in a changelog.
@@ -31,6 +33,13 @@ export interface Changelog {
sections: ChangelogSection[];
}
/**
* Returns the text of the header (without the '## ' prefix) of the given section.
* */
export function getHeader(section: ChangelogSection): string {
return section.headerLine.replace(/^#+\s+/, "").trimEnd();
}
/** Returns `date` formatted as `DD Mon YYYY`. */
export function getReleaseDateString(today: Date = new Date()): string {
return today.toLocaleDateString("en-GB", {
@@ -125,6 +134,42 @@ export function parseChangelog(content: string): Changelog {
return { preamble, sections };
}
/**
* Inserts the changenotes `lines` in the `[UNRELEASED]` section of `changelog`.
* If the section contains the stock message {@link NO_CHANGES_STR}, then
* `lines` will be inserted in place and the stock message will be deleted.
*
* @throws Error -- if the [UNRELEASED] section does not exist.
*
* @param changelog The CHANGELOG object to modify.
* @param lines The changenotes to insert.
*/
export function addBodyLinesToUnreleasedSection(
changelog: Changelog,
lines: string[],
) {
// Do nothing if there is nothing to insert.
if (lines.length === 0) return;
const unreleasedSection = changelog.sections[0];
if (getHeader(unreleasedSection) !== UNRELEASED_PLACEHOLDER) {
throw Error(
`'${UNRELEASED_PLACEHOLDER}' is not the first section of 'CHANGELOG.md'`,
);
}
if (unreleasedSection.bodyLines.includes(NO_CHANGES_STR)) {
unreleasedSection.bodyLines = ["", ...lines, ""];
return;
}
// The last body line should be a blank line (for spacing).
// Remove it so that we can add `lines` and then add the blank line back.
unreleasedSection.bodyLines.pop();
unreleasedSection.bodyLines.push(...lines);
unreleasedSection.bodyLines.push("");
}
/**
* Combines an array of lines into a single string by adding line breaks.
*/
@@ -204,7 +249,7 @@ export function processChangelogForBackports(
// Add an entry if we didn't keep any.
if (!foundContent) {
section.bodyLines.push(NO_CHANGES_STR.trim());
section.bodyLines.push(NO_CHANGES_STR);
}
}

View File

@@ -1,36 +1,18 @@
import assert from "node:assert/strict";
import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import { describe, it } from "node:test";
import { withTmpFile } from "../../src/util";
import {
hasValidChangenoteCategory,
isValidChangenoteContent,
isValidChangenoteFile,
isValidChangenoteFilename,
hasValidChangenoteCategory,
VALID_CHANGE_NOTE_CATEGORIES,
} from "./validate.ts";
async function withTmpFile<T>(
baseFileName: string,
contents: string,
body: (filePath: string) => Promise<T>,
): Promise<T> {
const tmpDir = fs.mkdtempSync(
path.join(os.tmpdir(), "changetool-validate-test-"),
);
try {
const filePath = path.join(tmpDir, baseFileName);
fs.writeFileSync(filePath, contents);
return await body(filePath);
} finally {
fs.rmSync(tmpDir, { recursive: true, force: true });
}
}
} from "./validate.mjs";
await describe("isValidChangenoteContent", async () => {
await it("recognizes an unordered Markdown list", async () => {
await it("recognizes an unordered Markdown list", () => {
const inputs = [
"- One changenote entry",
"- First item\n- Second item",
@@ -42,7 +24,7 @@ await describe("isValidChangenoteContent", async () => {
}
});
await it("does not recognize non-Markdown text", async () => {
await it("does not recognize non-Markdown text", () => {
const inputs = [
"This is not a list.",
'["this", "is", "JSON"]',
@@ -57,7 +39,7 @@ await describe("isValidChangenoteContent", async () => {
}
});
await it("does not recognize ordered Markdown lists", async () => {
await it("does not recognize ordered Markdown lists", () => {
const inputs = [
"1. First item\n2. Second item",
"\n\n\n1. First item\n1. Second item",
@@ -68,7 +50,7 @@ await describe("isValidChangenoteContent", async () => {
}
});
await it("requires all list items to use a hyphen bullet", async () => {
await it("requires all list items to use a hyphen bullet", () => {
const inputs = [
"* Fixed a bug\n* Added feature",
"+ Fixed a bug\n+ Added feature",
@@ -85,7 +67,7 @@ await describe("isValidChangenoteContent", async () => {
}
});
await it("does not contain other Markdown elements", async () => {
await it("does not contain other Markdown elements", () => {
const inputs = [
"- Fixed a bug\n\nParagraph of text",
"- Fixed a bug\n\n* Added a feature",
@@ -100,7 +82,7 @@ await describe("isValidChangenoteContent", async () => {
});
await describe("isValidChangenoteFilename", async () => {
await it("accepts valid filenames", async () => {
await it("accepts valid filenames", () => {
const inputs = [
"2023-01-01-fix-bug.md",
"2023-12-31-add-feature.md",
@@ -112,7 +94,7 @@ await describe("isValidChangenoteFilename", async () => {
}
});
await it("rejects invalid filenames", async () => {
await it("rejects invalid filenames", () => {
const inputs = [
"missing-date-from-filename.md",
"2021-01-01.md",
@@ -126,14 +108,14 @@ await describe("isValidChangenoteFilename", async () => {
});
await describe("hasValidChangenoteCategory", async () => {
await it("accepts valid categories", async () => {
await it("accepts valid categories", () => {
for (const category of Object.keys(VALID_CHANGE_NOTE_CATEGORIES)) {
const frontmatter = { category };
assert.equal(hasValidChangenoteCategory(frontmatter), true);
}
});
await it("rejects invalid categories", async () => {
await it("rejects invalid categories", () => {
const inputs = [
"",
"invalid-category",
@@ -150,7 +132,7 @@ await describe("hasValidChangenoteCategory", async () => {
}
});
await it("reject missing category", async () => {
await it("reject missing category", () => {
assert.equal(hasValidChangenoteCategory({}), false);
assert.equal(hasValidChangenoteCategory({ category: null }), false);
assert.equal(hasValidChangenoteCategory({ category: undefined }), false);
@@ -162,17 +144,21 @@ await describe("isValidChangenoteFile", async () => {
await withTmpFile(
"2026-01-01-fix-bug.md",
"---\ncategory: fix\n---\n- Fixed a bug\n",
async (filePath) => {
(filePath) => {
assert.equal(isValidChangenoteFile(filePath), true);
},
);
});
await it("rejects a non-existent path", async () => {
assert.equal(isValidChangenoteFile("non-existent-file.md"), false);
});
await it("rejects invalid filename", async () => {
await withTmpFile(
"fix-bug.md",
"---\ncategory: fix\n---\n- Fixed a bug\n",
async (filePath) => {
(filePath) => {
assert.equal(isValidChangenoteFile(filePath), false);
},
);
@@ -182,7 +168,7 @@ await describe("isValidChangenoteFile", async () => {
await withTmpFile(
"2026-01-01-fix-bug.md",
"- Fixed a bug\n",
async (filePath) => {
(filePath) => {
assert.equal(isValidChangenoteFile(filePath), false);
},
);
@@ -192,7 +178,7 @@ await describe("isValidChangenoteFile", async () => {
await withTmpFile(
"2026-01-01-fix-bug.md",
"---\ncategory: fix\n---\n* Fixed a bug\n",
async (filePath) => {
(filePath) => {
assert.equal(isValidChangenoteFile(filePath), false);
},
);

134
pr-checks/changenotes.mts Executable file
View File

@@ -0,0 +1,134 @@
#!/usr/bin/env npx tsx
import * as fs from "node:fs";
import { pathToFileURL } from "node:url";
import { parseArgs } from "node:util";
import path from "path";
import { ExitCode } from "@actions/core";
import { matter } from "lite-matter";
import {
addBodyLinesToUnreleasedSection,
parseChangelog,
renderChangelog,
withChangelog,
} from "./changelog";
import { isValidChangenoteFile } from "./changelog/validate.mjs";
import { CHANGENOTES_DIR } from "./config";
/**
* Describes a changenote file, including its file path, frontmatter, and content.
*/
interface ChangenoteFile {
absolutePath: string;
data: Record<string, any>;
content: string;
}
/**
* Returns the absolute file paths of all files in
* {@link CHANGENOTES_DIR} (except ".gitkeep").
* */
function listUnreleasedChangenoteDir(): string[] {
return fs
.readdirSync(CHANGENOTES_DIR)
.filter((name) => name !== ".gitkeep")
.map((name) => path.join(CHANGENOTES_DIR, name));
}
/**
* Scans the {@link CHANGENOTES_DIR} directory for changenote files
* and returns a parsed listing of those changenote files.
*/
function getChangenotes(): ChangenoteFile[] {
return listUnreleasedChangenoteDir().map((absolutePath) => {
return {
absolutePath,
...matter(fs.readFileSync(absolutePath, "utf-8")),
};
});
}
const entryPoint = process.argv[1];
if (entryPoint && import.meta.url === pathToFileURL(entryPoint).href) {
try {
process.exit(main());
} catch (error) {
console.error(error);
process.exit(ExitCode.Failure);
}
}
function main(): ExitCode {
const { positionals } = parseArgs({
allowPositionals: true,
strict: true,
});
const [command] = positionals;
switch (command) {
case undefined:
case "help":
return usage();
case "assemble":
return assemble();
case "validate":
return validate();
default:
console.error(`Unknown command: ${command}`);
return ExitCode.Failure;
}
}
function usage(): ExitCode {
const message =
"Usage: changenotes.mts assemble\n" +
" changenotes.mts validate\n" +
" changenotes.mts help";
console.log(message);
return ExitCode.Success;
}
function assemble(): ExitCode {
try {
const changenotes = getChangenotes();
const changenoteBodies = changenotes.map((c) => c.content);
const changenotePaths = changenotes.map((c) => c.absolutePath);
withChangelog((contents) => {
const changelog = parseChangelog(contents);
addBodyLinesToUnreleasedSection(changelog, changenoteBodies);
return renderChangelog(changelog);
}, {});
// Delete changenotes only after successful processing.
for (const p of changenotePaths) {
fs.unlinkSync(p);
}
return ExitCode.Success;
} catch (e) {
console.error("Failed to assemble changenotes to 'CHANGELOG.md'", e);
}
return ExitCode.Failure;
}
function validate(): ExitCode {
try {
const allChangenotesValid = getChangenotes().reduce(
(r, changenote) => r && isValidChangenoteFile(changenote.absolutePath),
true,
);
if (allChangenotesValid) {
console.log(`All changenotes in '${CHANGENOTES_DIR}' are valid.`);
return ExitCode.Success;
}
} catch (error) {
console.error(
`Failed to read changenotes directory '${CHANGENOTES_DIR}'`,
error,
);
}
return ExitCode.Failure;
}

View File

@@ -2,7 +2,8 @@ name: "All-platform bundle"
description: "Tests using an all-platform CodeQL Bundle"
operatingSystems:
- ubuntu
- macos
- os: macos
runner-image: macos-latest-xlarge
- windows
versions:
- nightly-latest

View File

@@ -30,7 +30,8 @@ steps:
- id: init
uses: ./../action/init
with:
languages: javascript
# Request multiple languages so this check uses the combined bundle.
languages: javascript,python
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/analyze
with:

View File

@@ -0,0 +1,117 @@
name: Per-language bundles
description: Validates extraction and analysis using each per-language CodeQL bundle.
# TODO: Use a released bundle once releases include per-language bundles.
matrix:
include:
- language: actions
os: ubuntu-latest
version: nightly-latest
# Actions also needs the JavaScript extractor.
expected-extractors: actions javascript
- language: cpp
os: ubuntu-latest
version: nightly-latest
build-mode: manual
build-command: gcc -o main main.c
- language: csharp
os: ubuntu-latest
version: nightly-latest
build-mode: none
- language: go
os: ubuntu-latest
version: nightly-latest
build-mode: autobuild
- language: java
os: ubuntu-latest
version: nightly-latest
build-mode: none
- language: javascript
os: ubuntu-latest
version: nightly-latest
- language: python
os: ubuntu-latest
version: nightly-latest
- language: ruby
os: ubuntu-latest
version: nightly-latest
- language: rust
os: ubuntu-latest
version: nightly-latest
- language: swift
os: macos-latest-xlarge
version: nightly-latest
build-mode: autobuild
env:
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true
steps:
- uses: ./../action/init
id: init
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix['build-mode'] }}
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check that the bundle contains only the expected extractors
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
LANGUAGE: ${{ matrix.language }}
EXPECTED_EXTRACTORS: ${{ matrix['expected-extractors'] || matrix.language }}
run: |
extractors="$("$CODEQL_PATH" resolve languages --format=json | jq -r 'keys[]')"
echo "Extractors in the bundle:"
echo "$extractors"
echo "Expected: $EXPECTED_EXTRACTORS"
for expected in $EXPECTED_EXTRACTORS; do
if ! echo "$extractors" | grep -qx "$expected"; then
echo "::error::The ${LANGUAGE} bundle does not contain the ${expected} extractor."
exit 1
fi
done
# If the bundle contained extractors beyond those the language needs, then it would not
# have been trimmed, and this job would be silently validating the combined bundle.
for other in actions cpp csharp go java javascript python ruby rust swift; do
if echo "$EXPECTED_EXTRACTORS" | grep -qw "$other"; then
continue
fi
if echo "$extractors" | grep -qx "$other"; then
echo "::error::The ${LANGUAGE} bundle also contains the ${other} extractor, so it is not trimmed."
exit 1
fi
done
- name: Check that the bundle was not added to the toolcache
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
# A bundle that is missing most of its extractors must never be left in the toolcache,
# where a later job analyzing a different language could pick it up. The runner image
# ships with its own CodeQL in the toolcache, so check where this bundle was extracted to
# rather than whether the toolcache contains CodeQL at all.
echo "CodeQL is at $CODEQL_PATH"
if [[ "$CODEQL_PATH" == "$RUNNER_TOOL_CACHE"/* ]]; then
echo "::error::The per-language bundle was added to the toolcache at $CODEQL_PATH."
exit 1
fi
if [[ "$CODEQL_PATH" != "$RUNNER_TEMP"/* ]]; then
echo "::error::Expected the per-language bundle to be extracted under $RUNNER_TEMP, but found it at $CODEQL_PATH."
exit 1
fi
- name: Build code
if: matrix['build-command']
run: ${{ matrix['build-command'] }}
- uses: ./../action/analyze
id: analysis
with:
upload-database: false
- name: Check that a database was created for the language
env:
DB_LOCATIONS: ${{ steps.analysis.outputs.db-locations }}
LANGUAGE: ${{ matrix.language }}
run: |
database="$(echo "$DB_LOCATIONS" | jq -r --arg lang "$LANGUAGE" '.[$lang] // empty')"
if [ -z "$database" ] || [ ! -d "$database" ]; then
echo "::error::No CodeQL database was created for ${LANGUAGE}."
echo "Databases: $DB_LOCATIONS"
exit 1
fi
echo "Created a ${LANGUAGE} database at ${database}."

View File

@@ -5,7 +5,7 @@ versions:
- default
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
uses: ruby/setup-ruby@984c0c890880bbf811283d6f09c4607c62d210a4 # v1.323.0
with:
ruby-version: 2.6
- name: Install Code Scanning integration

View File

@@ -5,7 +5,8 @@ versions:
- default
- nightly-latest
operatingSystems:
- macos
- os: macos
runner-image: macos-latest-xlarge
installGo: true
installDotNet: true
env:

View File

@@ -18,6 +18,9 @@ export const PACKAGE_JSON = path.join(REPO_ROOT, "package.json");
/** The path of the changelog. */
export const CHANGELOG_FILE = path.join(REPO_ROOT, "CHANGELOG.md");
/** The path to the unreleased change-notes directory. */
export const CHANGENOTES_DIR = path.join(REPO_ROOT, "unreleased-change-notes");
/** The path to the esbuild metadata file. */
export const BUNDLE_METADATA_FILE = path.join(REPO_ROOT, "meta.json");

View File

@@ -1,17 +1,19 @@
{
"private": true,
"description": "Dependencies for the sync.ts",
"description": "Dependencies for codeql-action scripts",
"dependencies": {
"@actions/core": "^2.0.3",
"@actions/github": "^8.0.1",
"@octokit/core": "^7.0.7",
"@octokit/core": "^7.0.8",
"@octokit/plugin-paginate-rest": ">=15.0.0",
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
"lite-matter": "^0.1.2",
"mdast-util-from-markdown": "^2.0.3",
"semver": "^7.8.5",
"yaml": "^2.9.0"
"yaml": "^2.9.1"
},
"devDependencies": {
"@types/node": "^20.19.43",
"tsx": "^4.23.12"
"tsx": "^4.23.13"
}
}

View File

@@ -4,12 +4,19 @@ set -e
cd "$(dirname "$0")"
# Run `npm ci` in CI or `npm install` otherwise.
#
# `pr-checks` is an npm workspace of the repository root and the two share a single hoisted
# `node_modules` directory. Running npm from this directory puts it in workspace mode, where it
# ignores the root project's own dependencies by default. `npm ci` would then rebuild the shared
# `node_modules` with only this workspace's dependencies, removing the root's ones, which breaks
# anything that imports from `src` (such as `sync.ts` itself). `--include-workspace-root` keeps the
# root project's dependencies in the installed tree.
if [ "$GITHUB_ACTIONS" = "true" ]; then
echo "In Actions, running 'npm ci' for 'sync.ts'..."
npm ci
npm ci --include-workspace-root
else
echo "Running 'npm install' for 'sync.ts'..."
npm install --no-audit --no-fund
npm install --no-audit --no-fund --include-workspace-root
fi
npx tsx sync.ts

View File

@@ -79,6 +79,8 @@ interface Specification extends JobSpecification {
useAllPlatformBundle?: string;
/** Values for the `analysis-kinds` matrix dimension. */
analysisKinds?: string[];
/** Overrides the generated job matrix using GitHub Actions matrix syntax. */
matrix?: Record<string, unknown>;
/** Container image configuration for the job. */
container?: any;
@@ -253,8 +255,8 @@ const languageSetups: LanguageSetups = {
name: "Install Java",
uses: pinnedUses(
"actions/setup-java",
"dd06d9cba3e5552c54d9f8ea23572deb30010f7c",
"v6.0.0",
"de7274f081f381c8f8158605e0321c36c376e2e6",
"v6.0.1",
),
with: {
"java-version": `\${{ inputs.java-version || '${defaultLanguageVersions.java}' }}`,
@@ -512,9 +514,6 @@ function generateJob(
specDocument: yaml.Document,
checkSpecification: Specification,
) {
const matrix: Array<Record<string, any>> =
generateJobMatrix(checkSpecification);
const useAllPlatformBundle = checkSpecification.useAllPlatformBundle
? checkSpecification.useAllPlatformBundle
: "false";
@@ -567,8 +566,8 @@ function generateJob(
const checkJob: Record<string, any> = {
strategy: {
"fail-fast": false,
matrix: {
include: matrix,
matrix: checkSpecification.matrix ?? {
include: generateJobMatrix(checkSpecification),
},
},
name: checkSpecification.name,

View File

@@ -6,8 +6,8 @@
"module": "preserve",
"rootDir": "..",
"sourceMap": false,
"noEmit": true,
"noEmit": true
},
"include": ["./*.ts", "../src/**/*.ts"],
"include": ["./**/*.ts", "./**/*.mts", "../src/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -21,5 +21,5 @@ outputs:
environment:
description: The inferred build environment configuration.
runs:
using: node24
using: node20
main: '../lib/resolve-environment-entry.js'

View File

@@ -1,51 +0,0 @@
import { pathToFileURL } from "node:url";
import { parseArgs } from "node:util";
import { isValidChangenoteFile } from "./cli/validate.ts";
const entryPoint = process.argv[1];
if (entryPoint && import.meta.url === pathToFileURL(entryPoint).href) {
try {
process.exit(main());
} catch (error) {
console.error(error);
process.exit(1);
}
}
function main(): number {
const { positionals } = parseArgs({
allowPositionals: true,
strict: true,
});
const [command, ...paths] = positionals;
switch (command) {
case undefined:
case "help":
return usage();
case "validate":
return validate(paths);
default:
console.error(`Unknown command: ${command}`);
return 1;
}
}
function usage(): number {
console.log("Usage: changetool validate <path> [<path> ...]");
return 0;
}
function validate(paths: string[]): number {
let valid = true;
if (paths.length === 0) {
console.error("error: no paths provided (see 'help' command for usage)");
return 1;
}
for (const path of paths) {
if (!isValidChangenoteFile(path)) {
valid = false;
}
}
return valid ? 0 : 1;
}

View File

@@ -1,21 +0,0 @@
{
"name": "changetool",
"version": "1.0.0",
"private": true,
"description": "Validates change-notes and merges them into CHANGELOG.md",
"license": "MIT",
"type": "module",
"scripts": {
"start": "tsx index.ts",
"test": "node --test --experimental-strip-types cli/*.test.ts"
},
"devDependencies": {
"@types/node": "^26.2.0",
"tsx": "^4.23.12",
"typescript": "^7.0.2"
},
"dependencies": {
"lite-matter": "^0.1.2",
"mdast-util-from-markdown": "^2.0.3"
}
}

View File

@@ -1,11 +0,0 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "preserve",
"allowImportingTsExtensions": true,
"rootDir": ".",
"sourceMap": false
},
"include": ["./**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -54,5 +54,5 @@ outputs:
codeql-version:
description: The version of the CodeQL binary that was installed.
runs:
using: node24
using: node20
main: '../lib/setup-codeql-entry.js'

View File

@@ -7,7 +7,7 @@ import * as github from "@actions/github";
import * as io from "@actions/io";
import type { Config } from "./config-utils";
import { Env, EnvVar, ActionsEnvVars } from "./environment";
import { Env, EnvVar, ActionsEnvVars, ReadOnlyEnv } from "./environment";
import { Logger } from "./logging";
import {
doesDirectoryExist,
@@ -292,7 +292,7 @@ export function isSelfHostedRunner(env: Env = getEnv()) {
* that are configured to resemble hosted ones, such as those that mount a persistent volume at
* `/opt/hostedtoolcache`.
*/
export function isGitHubHostedRunner(env: Env = getEnv()) {
export function isGitHubHostedRunner(env: ReadOnlyEnv = getEnv()) {
return env.getOptional(ActionsEnvVars.RUNNER_ENVIRONMENT) === "github-hosted";
}

View File

@@ -212,7 +212,11 @@ async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) {
await runAutobuild(config, BuiltInLanguage.go, logger);
}
async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
async function run({
startedAt,
logger,
actions,
}: ActionState<["Base", "Logger", "Actions"]>) {
// To capture errors appropriately, keep as much code within the try-catch as
// possible, and only use safe functions outside.
@@ -307,8 +311,13 @@ async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
logger,
);
const checkoutPath = actions.getRequiredInput("checkout_path");
// Setup diff informed analysis if needed (based on whether init created the file)
const diffRangePackDir = await setupDiffInformedQueryRun(logger);
const diffRangePackDir = await setupDiffInformedQueryRun(
logger,
checkoutPath,
);
await warnIfGoInstalledAfterInit(config, logger);
await runAutobuildIfLegacyGoWorkflow(config, logger);
@@ -354,7 +363,6 @@ async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
actionsUtil.getOptionalInput("upload"),
);
if (runStats) {
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
const category = actionsUtil.getOptionalInput("category");
uploadResults = await postProcessAndUploadSarif(
@@ -388,18 +396,23 @@ async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) {
// Possibly upload the overlay-base database to actions cache.
// Note: Take care with the ordering of this call since databases may be cleaned up
// at the `overlay` level.
await cleanupAndUploadOverlayBaseDatabaseToCache(codeql, config, logger);
await cleanupAndUploadOverlayBaseDatabaseToCache(
codeql,
config,
logger,
checkoutPath,
);
// Possibly upload the database bundles for remote queries.
// Note: Take care with the ordering of this call since databases may be cleaned up
// at the `overlay` or `clear` level.
databaseUploadResults = await cleanupAndUploadDatabases(
{ logger, features },
repositoryNwo,
codeql,
config,
apiDetails,
features,
logger,
checkoutPath,
);
// Possibly upload the TRAP caches for later re-use

View File

@@ -5,7 +5,7 @@ import { performance } from "perf_hooks";
import * as io from "@actions/io";
import * as yaml from "js-yaml";
import { getTemporaryDirectory, getRequiredInput } from "./actions-util";
import { getTemporaryDirectory } from "./actions-util";
import * as analyses from "./analyses";
import { setupCppAutobuild } from "./autobuild";
import { type CodeQL } from "./codeql";
@@ -233,6 +233,7 @@ async function finalizeDatabaseCreation(
*/
export async function setupDiffInformedQueryRun(
logger: Logger,
checkoutPath: string,
): Promise<string | undefined> {
return await withGroupAsync(
"Generating diff range extension pack",
@@ -245,7 +246,6 @@ export async function setupDiffInformedQueryRun(
return undefined;
}
const checkoutPath = getRequiredInput("checkout_path");
const packDir = writeDiffRangeDataExtensionPack(
logger,
diffRanges,

56
src/codeql-bundle.test.ts Normal file
View File

@@ -0,0 +1,56 @@
import test from "ava";
import { getCodeQLBundleFromUrl } from "./codeql-bundle";
import { BuiltInLanguage } from "./languages";
for (const [assetName, language] of [
["codeql-bundle-java-linux64.tar.zst", BuiltInLanguage.java],
["codeql-bundle-swift-osx64.tar.zst", BuiltInLanguage.swift],
// Recognize unpublished language/platform combinations to keep them out of the toolcache.
["codeql-bundle-csharp-win64.tar.gz", BuiltInLanguage.csharp],
["codeql-bundle-java-kotlin-linux64.tar.zst", BuiltInLanguage.java],
["codeql-bundle-%70ython-linux64.tar.zst", BuiltInLanguage.python],
] as const) {
test(`getCodeQLBundleFromUrl identifies ${assetName} without adding a fallback`, (t) => {
const url = `https://github.com/github/codeql-action/releases/download/codeql-bundle-v1.2.3/${assetName}`;
t.deepEqual(getCodeQLBundleFromUrl(url), {
kind: "per-language",
url,
language,
});
});
}
test("getCodeQLBundleFromUrl preserves encoding, query parameters and fragments", (t) => {
const url =
"https://github.com/github/codeql-action/releases/download/codeql-bundle-v1.2.3/codeql-bundle-%70ython-linux64.tar.zst?download=1#asset";
t.deepEqual(getCodeQLBundleFromUrl(url), {
kind: "per-language",
url,
language: BuiltInLanguage.python,
});
});
test("getCodeQLBundleFromUrl treats unrecognized assets as combined bundles", (t) => {
for (const name of [
"codeql-bundle-linux64.tar.zst",
"codeql-bundle-osx64.tar.gz",
"codeql-bundle-win64.tar.zst",
// The all-platform bundle.
"codeql-bundle.tar.gz",
// A platform we do not publish per-language bundles for, whose name also contains a hyphen.
"codeql-bundle-linux-arm64.tar.zst",
// Not a language we know about.
"codeql-bundle-cobol-linux64.tar.zst",
// A name we cannot decode must not be mistaken for a language either.
"codeql-bundle-%zz-linux64.tar.zst",
]) {
const url = `https://github.com/github/codeql-action/releases/download/codeql-bundle-v1.2.3/${name}`;
t.deepEqual(getCodeQLBundleFromUrl(url), { kind: "combined", url });
}
});
test("getCodeQLBundleFromUrl preserves URLs it cannot parse", (t) => {
const url = "not a url";
t.deepEqual(getCodeQLBundleFromUrl(url), { kind: "combined", url });
});

33
src/codeql-bundle.ts Normal file
View File

@@ -0,0 +1,33 @@
import { BuiltInLanguage, parseBuiltInLanguage } from "./languages";
/** Describes the contents and location of a downloadable CodeQL bundle. */
export type CodeQLBundle =
| { kind: "combined"; url: string }
| {
kind: "per-language";
url: string;
language: BuiltInLanguage;
/** Only set when the Action selected the bundle, allowing a same-version fallback. */
combinedBundleURL?: string;
};
const PER_LANGUAGE_BUNDLE_NAME =
/^codeql-bundle-(.+)-(?:linux64|osx64|win64)\.tar\.(?:gz|zst)$/;
/** Classifies an explicit tools URL without changing it or adding a fallback. */
export function getCodeQLBundleFromUrl(url: string): CodeQLBundle {
let assetName: string;
try {
const pathname = new URL(url).pathname;
// URL-encoded names must not bypass the toolcache safeguard.
assetName = decodeURIComponent(pathname.split("/").pop() ?? "");
} catch {
return { kind: "combined", url };
}
const match = assetName.match(PER_LANGUAGE_BUNDLE_NAME);
const language = match ? parseBuiltInLanguage(match[1]) : undefined;
return language === undefined
? { kind: "combined", url }
: { kind: "per-language", url, language };
}

View File

@@ -90,7 +90,7 @@ async function installIntoToolcache({
tmpDir: string;
}) {
const url = mockBundleDownloadApi({ apiDetails, isPinned, tagName });
await codeql.setupCodeQL(
return await codeql.setupCodeQL(
cliVersion !== undefined ? undefined : url,
apiDetails,
tmpDir,
@@ -259,6 +259,65 @@ test.serial(
},
);
for (const { cliVersion, tagName, expectedToolcacheVersion } of [
{
cliVersion: "2.21.0",
tagName: "codeql-bundle-20240101",
expectedToolcacheVersion: "2.21.0",
},
{
cliVersion: "2.21.0-rc.1",
tagName: "codeql-bundle-20240101",
expectedToolcacheVersion: "0.0.0-20240101",
},
{
cliVersion: "2.21.0+20240101",
tagName: "codeql-bundle-20240101",
expectedToolcacheVersion: "0.0.0-20240101",
},
{
cliVersion: "2.21.0",
tagName: "custom-release",
expectedToolcacheVersion: undefined,
},
]) {
test.serial(
`preserves CLI version ${cliVersion} when installing ${tagName}`,
async (t) => {
await util.withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const result = await installIntoToolcache({
cliVersion,
isPinned: false,
tagName,
tmpDir,
});
t.is(result.toolsVersion, cliVersion);
t.is(result.toolsSource, ToolsSource.Download);
t.true(
Number.isInteger(result.toolsDownloadStatusReport?.totalDurationMs),
);
t.deepEqual(
toolcache.findAllVersions("CodeQL"),
expectedToolcacheVersion === undefined
? []
: [expectedToolcacheVersion],
);
if (expectedToolcacheVersion !== undefined) {
const cachedFolder = toolcache.find(
"CodeQL",
expectedToolcacheVersion,
);
t.truthy(cachedFolder);
t.true(fs.existsSync(`${cachedFolder}.complete`));
}
});
},
);
}
const EXPLICITLY_REQUESTED_BUNDLE_TEST_CASES = [
{
tagName: "codeql-bundle-2.17.6",

View File

@@ -937,6 +937,7 @@ async function getCodeQLForCmd(
"--format=json",
`--language=${language}`,
"--extractor-include-aliases",
"-J-XX:-UsePerfData",
...getExtraOptionsFromEnv(["resolve", "extractor"]),
],
{

View File

@@ -20,8 +20,9 @@ import {
checkExpectedLogMessages,
createFeatures,
createTestConfig,
getRecordingLogger,
LoggedMessage,
getTestEnv,
initAllState,
RecordingLogger,
setupActionsVars,
setupTests,
} from "./testing-utils";
@@ -90,23 +91,24 @@ test.serial(
"Abort database upload if 'upload-database' input set to false",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
.returns("false");
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true);
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
getTestConfig(tmpDir),
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Database upload disabled in workflow. Skipping upload.",
]);
});
@@ -117,7 +119,8 @@ test.serial(
"Abort database upload if 'analysis-kinds: code-scanning' is not enabled",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -126,8 +129,9 @@ test.serial(
await mockHttpRequests(201);
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
{
@@ -135,10 +139,9 @@ test.serial(
analysisKinds: [AnalysisKind.CodeQuality],
},
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Not uploading database because 'analysis-kinds: code-scanning' is not enabled.",
]);
});
@@ -147,7 +150,8 @@ test.serial(
test.serial("Abort database upload if running against GHES", async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -157,16 +161,16 @@ test.serial("Abort database upload if running against GHES", async (t) => {
const config = getTestConfig(tmpDir);
config.gitHubVersion = { type: GitHubVariant.GHES, version: "3.0" };
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
config,
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Not running against github.com or GHEC-DR. Skipping upload.",
]);
});
@@ -176,23 +180,24 @@ test.serial(
"Abort database upload if not analyzing default branch",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
.returns("true");
sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false);
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
getTestConfig(tmpDir),
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Not analyzing default branch. Skipping upload.",
]);
});
@@ -203,7 +208,8 @@ test.serial(
"Don't crash if uploading a database fails with a non-retryable error",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -212,17 +218,17 @@ test.serial(
const databaseUploadSpy = await mockHttpRequests(422);
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
getTestConfig(tmpDir),
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Failed to upload database for javascript: some error message",
]);
@@ -236,7 +242,8 @@ test.serial(
"Don't crash if uploading a database fails with a retryable error",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -251,17 +258,17 @@ test.serial(
.stub(global, "setTimeout")
.callsFake((fn: () => void) => originalSetTimeout(fn, 0));
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
getTestConfig(tmpDir),
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Failed to upload database for javascript: some error message",
]);
@@ -279,7 +286,8 @@ test.serial(
test.serial("Successfully uploading a database to github.com", async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -288,16 +296,16 @@ test.serial("Successfully uploading a database to github.com", async (t) => {
await mockHttpRequests(201);
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
getTestConfig(tmpDir),
testApiDetails,
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Successfully uploaded database for javascript",
]);
});
@@ -305,7 +313,8 @@ test.serial("Successfully uploading a database to github.com", async (t) => {
test.serial("Successfully uploading a database to GHEC-DR", async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -314,8 +323,9 @@ test.serial("Successfully uploading a database to GHEC-DR", async (t) => {
const databaseUploadSpy = await mockHttpRequests(201);
const loggedMessages: LoggedMessage[] = [];
const logger = new RecordingLogger();
await cleanupAndUploadDatabases(
initAllState({ env, logger }),
testRepoName,
getCodeQL(),
getTestConfig(tmpDir),
@@ -324,10 +334,9 @@ test.serial("Successfully uploading a database to GHEC-DR", async (t) => {
url: "https://tenant.ghe.com",
apiURL: undefined,
},
createFeatures([]),
getRecordingLogger(loggedMessages),
"",
);
checkExpectedLogMessages(t, loggedMessages, [
checkExpectedLogMessages(t, logger.messages, [
"Successfully uploaded database for javascript",
]);
t.assert(
@@ -343,7 +352,8 @@ test.serial(
"Records overlay and clear cleanup sizes when uploading an overlay-base database",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -375,14 +385,16 @@ test.serial(
const config = getTestConfig(tmpDir);
config.overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
const loggedMessages: LoggedMessage[] = [];
const results = await cleanupAndUploadDatabases(
initAllState({
env,
features: createFeatures([Feature.UploadOverlayDbToApi]),
}),
testRepoName,
codeql,
config,
testApiDetails,
createFeatures([Feature.UploadOverlayDbToApi]),
getRecordingLogger(loggedMessages),
"",
);
// The database should be cleaned up at the `overlay` level for the upload
@@ -402,7 +414,8 @@ test.serial(
"Does not measure clear cleanup size for a regular (non-overlay-base) upload",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -422,12 +435,15 @@ test.serial(
});
const results = await cleanupAndUploadDatabases(
initAllState({
env,
features: createFeatures([Feature.UploadOverlayDbToApi]),
}),
testRepoName,
codeql,
getTestConfig(tmpDir),
testApiDetails,
createFeatures([Feature.UploadOverlayDbToApi]),
getRecordingLogger([]),
"",
);
// A regular upload is cleaned only once, at the `clear` level.
@@ -441,7 +457,8 @@ test.serial(
test.serial("Does not measure clear cleanup size in debug mode", async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -465,12 +482,15 @@ test.serial("Does not measure clear cleanup size in debug mode", async (t) => {
config.debugMode = true;
const results = await cleanupAndUploadDatabases(
initAllState({
env,
features: createFeatures([Feature.UploadOverlayDbToApi]),
}),
testRepoName,
codeql,
config,
testApiDetails,
createFeatures([Feature.UploadOverlayDbToApi]),
getRecordingLogger([]),
"",
);
// In debug mode we clean up at the `overlay` level for the upload but skip
@@ -486,7 +506,8 @@ test.serial(
"Does not record a clear cleanup duration when the clear cleanup fails",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
const env = getTestEnv();
setupActionsVars(tmpDir, tmpDir, {}, env);
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("upload-database")
@@ -510,12 +531,15 @@ test.serial(
config.overlayDatabaseMode = OverlayDatabaseMode.OverlayBase;
const results = await cleanupAndUploadDatabases(
initAllState({
env,
features: createFeatures([Feature.UploadOverlayDbToApi]),
}),
testRepoName,
codeql,
config,
testApiDetails,
createFeatures([Feature.UploadOverlayDbToApi]),
getRecordingLogger([]),
"",
);
// When the `clear` cleanup fails, no size is measured, so we should not

View File

@@ -1,5 +1,6 @@
import * as fs from "fs";
import { ActionState } from "./action-common";
import * as actionsUtil from "./actions-util";
import { AnalysisKind } from "./analyses";
import {
@@ -9,7 +10,7 @@ import {
} from "./api-client";
import { type CodeQL } from "./codeql";
import { Config } from "./config-utils";
import { Feature, FeatureEnablement } from "./feature-flags";
import { Feature } from "./feature-flags";
import * as gitUtils from "./git-utils";
import { Logger, withGroupAsync } from "./logging";
import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
@@ -45,13 +46,15 @@ export interface DatabaseUploadResult {
}
export async function cleanupAndUploadDatabases(
action: ActionState<["Logger", "FeatureFlags"]>,
repositoryNwo: RepositoryNwo,
codeql: CodeQL,
config: Config,
apiDetails: GitHubApiDetails,
features: FeatureEnablement,
logger: Logger,
checkoutPath: string,
): Promise<DatabaseUploadResult[]> {
const logger = action.logger;
if (actionsUtil.getRequiredInput("upload-database") !== "true") {
logger.debug("Database upload disabled in workflow. Skipping upload.");
return [];
@@ -87,7 +90,7 @@ export async function cleanupAndUploadDatabases(
// If config.overlayDatabaseMode is OverlayBase, then we have overlay base databases for all languages.
const shouldUploadOverlayBase =
config.overlayDatabaseMode === OverlayDatabaseMode.OverlayBase &&
(await features.getValue(Feature.UploadOverlayDbToApi, codeql));
(await action.features.getValue(Feature.UploadOverlayDbToApi, codeql));
const cleanupLevel = shouldUploadOverlayBase
? CleanupLevel.Overlay
: CleanupLevel.Clear;
@@ -110,9 +113,7 @@ export async function cleanupAndUploadDatabases(
includeDiagnostics: false,
});
bundledDbSize = fs.statSync(bundledDb).size;
const commitOid = await gitUtils.getCommitOid(
actionsUtil.getRequiredInput("checkout_path"),
);
const commitOid = await gitUtils.getCommitOid(checkoutPath);
// Upload with manual retry logic. We disable Octokit's built-in retries
// because the request body is a ReadStream, which can only be consumed
// once.

View File

@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.26.4",
"cliVersion": "2.26.4",
"priorBundleVersion": "codeql-bundle-v2.26.3",
"priorCliVersion": "2.26.3"
"bundleVersion": "codeql-bundle-v2.27.1",
"cliVersion": "2.27.1",
"priorBundleVersion": "codeql-bundle-v2.27.0",
"priorCliVersion": "2.27.0"
}

View File

@@ -164,6 +164,11 @@ export enum Feature {
OverlayAnalysisStatusCheck = "overlay_analysis_status_check",
/** Controls whether overlay build failures on the default branch are stored in the Actions cache. */
OverlayAnalysisStatusSave = "overlay_analysis_status_save",
/**
* Controls whether we may download a bundle containing only the single language being analysed,
* rather than the combined bundle that contains every language.
*/
PerLanguageBundles = "per_language_bundles",
QaTelemetryEnabled = "qa_telemetry_enabled",
/** Routes (some) API requests through the registry proxy. */
ProxyApiRequests = "proxy_api_requests",
@@ -434,6 +439,11 @@ export const featureConfig = {
envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS",
minimumVersion: undefined,
},
[Feature.PerLanguageBundles]: {
defaultValue: false,
envVar: "CODEQL_ACTION_PER_LANGUAGE_BUNDLES",
minimumVersion: undefined,
},
[Feature.QaTelemetryEnabled]: {
defaultValue: false,
envVar: "CODEQL_ACTION_QA_TELEMETRY",

View File

@@ -29,10 +29,13 @@ test.serial(
process.env["GITHUB_SHA"] = currentSha;
const callback = sinon.stub(gitUtils, "getCommitOid");
callback.withArgs("HEAD").resolves(currentSha);
callback.withArgs(sinon.match.string, "HEAD").resolves(currentSha);
const actualRef = await gitUtils.getRef();
t.deepEqual(actualRef, expectedRef);
t.is(callback.callCount, 1);
t.true(callback.calledOnceWith(tmpDir, "HEAD"));
});
},
);
@@ -48,11 +51,17 @@ test.serial(
const sha = "a".repeat(40);
const callback = sinon.stub(gitUtils, "getCommitOid");
callback.withArgs("refs/remotes/pull/1/merge").resolves(sha);
callback.withArgs("HEAD").resolves(sha);
callback
.withArgs(sinon.match.string, "refs/remotes/pull/1/merge")
.resolves(sha);
callback.withArgs(sinon.match.any, "HEAD").resolves(sha);
const actualRef = await gitUtils.getRef();
t.deepEqual(actualRef, expectedRef);
t.is(callback.callCount, 2);
t.true(callback.calledWith(tmpDir, "HEAD"));
t.true(callback.calledWith(tmpDir, "refs/remotes/pull/1/merge"));
});
},
);
@@ -66,11 +75,18 @@ test.serial(
process.env["GITHUB_SHA"] = "a".repeat(40);
const callback = sinon.stub(gitUtils, "getCommitOid");
callback.withArgs(tmpDir, "refs/pull/1/merge").resolves("a".repeat(40));
callback
.withArgs(tmpDir, "refs/remotes/pull/1/merge")
.resolves("a".repeat(40));
callback.withArgs(tmpDir, "HEAD").resolves("b".repeat(40));
callback.throws(new Error("Unexpected getCommitOid call in test."));
const actualRef = await gitUtils.getRef();
t.deepEqual(actualRef, "refs/pull/1/head");
t.is(callback.callCount, 2);
t.true(callback.calledWith(tmpDir, "refs/remotes/pull/1/merge"));
t.true(callback.calledWith(tmpDir, "HEAD"));
});
},
);
@@ -92,11 +108,14 @@ test.serial(
process.env["GITHUB_SHA"] = "a".repeat(40);
const callback = sinon.stub(gitUtils, "getCommitOid");
callback.withArgs("refs/pull/1/merge").resolves("b".repeat(40));
callback.withArgs("HEAD").resolves("b".repeat(40));
callback.withArgs(tmpDir, "refs/pull/1/merge").resolves("b".repeat(40));
callback.withArgs(sinon.match.any, "HEAD").resolves("b".repeat(40));
const actualRef = await gitUtils.getRef();
t.deepEqual(actualRef, "refs/pull/2/merge");
// getCommitOid shouldn't be called, because the ref should be taken from the input
t.is(callback.callCount, 0);
});
},
);

View File

@@ -38,7 +38,7 @@ import {
makeDiagnostic,
makeTelemetryDiagnostic,
} from "./diagnostics";
import { EnvVar } from "./environment";
import { ActionsEnvVars, EnvVar } from "./environment";
import { Feature, FeatureEnablement, initFeatures } from "./feature-flags";
import { loadRepositoryProperties } from "./feature-flags/properties";
import {
@@ -63,13 +63,13 @@ import { ToolsSource } from "./setup-codeql";
import {
ActionName,
InitStatusReport,
InitToolsDownloadFields,
InitWithConfigStatusReport,
createInitWithConfigStatusReport,
createStatusReportBase,
getActionsStatus,
sendStatusReport,
} from "./status-report";
import { createInitToolsDownloadFields } from "./status-report/tools-download";
import { ToolsDownloadStatusReport } from "./tools-download";
import { ToolsFeature } from "./tools-features";
import { getCombinedTracerConfig } from "./tracer-config";
@@ -81,7 +81,6 @@ import {
DEFAULT_DEBUG_ARTIFACT_NAME,
DEFAULT_DEBUG_DATABASE_NAME,
getCodeQLMemoryLimit,
getRequiredEnvParam,
getThreadsFlagValue,
initializeEnvironment,
ConfigurationError,
@@ -168,23 +167,10 @@ async function sendCompletedStatusReport(
initStatusReport.computed_inputs.tools = toolsInput;
}
const initToolsDownloadFields: InitToolsDownloadFields = {};
if (toolsDownloadStatusReport?.downloadDurationMs !== undefined) {
initToolsDownloadFields.tools_download_duration_ms =
toolsDownloadStatusReport.downloadDurationMs;
}
if (toolsDownloadStatusReport?.extractionDurationMs !== undefined) {
initToolsDownloadFields.tools_extraction_duration_ms =
toolsDownloadStatusReport.extractionDurationMs;
}
if (toolsDownloadStatusReport?.totalDurationMs !== undefined) {
initToolsDownloadFields.tools_total_duration_ms =
toolsDownloadStatusReport.totalDurationMs;
}
if (toolsFeatureFlagsValid !== undefined) {
initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
}
const initToolsDownloadFields = createInitToolsDownloadFields(
toolsDownloadStatusReport,
toolsFeatureFlagsValid,
);
if (config !== undefined) {
// Append fields that are dependent on `config`
@@ -238,8 +224,8 @@ async function run(
apiDetails = {
auth: getRequiredInput("token"),
externalRepoAuth: getOptionalInput("external-repository-token"),
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
apiURL: getRequiredEnvParam("GITHUB_API_URL"),
url: actionState.env.getRequired(ActionsEnvVars.GITHUB_SERVER_URL),
apiURL: actionState.env.getRequired(ActionsEnvVars.GITHUB_API_URL),
};
const gitHubVersion = await getGitHubVersion();
@@ -268,7 +254,7 @@ async function run(
// source-root is relative, it is relative to the GITHUB_WORKSPACE. If
// source-root is absolute, it is used as given.
sourceRoot = path.resolve(
getRequiredEnvParam("GITHUB_WORKSPACE"),
actionState.env.getRequired(ActionsEnvVars.GITHUB_WORKSPACE),
getOptionalInput("source-root") || "",
);
@@ -396,7 +382,9 @@ async function run(
repository: repositoryNwo,
tempDir: getTemporaryDirectory(),
codeql,
workspacePath: getRequiredEnvParam("GITHUB_WORKSPACE"),
workspacePath: actionState.env.getRequired(
ActionsEnvVars.GITHUB_WORKSPACE,
),
sourceRoot,
githubVersion: gitHubVersion,
apiDetails,

View File

@@ -3,11 +3,7 @@ import * as fs from "fs";
import * as actionsCache from "@actions/cache";
import * as semver from "semver";
import {
getRequiredInput,
getWorkflowRunAttempt,
getWorkflowRunID,
} from "../actions-util";
import { getWorkflowRunAttempt, getWorkflowRunID } from "../actions-util";
import { getAutomationID, listActionsCaches } from "../api-client";
import { createCacheKeyHash } from "../caching-utils";
import { type CodeQL } from "../codeql";
@@ -107,12 +103,13 @@ async function checkOverlayBaseDatabase(
* Uploads the overlay-base database to the GitHub Actions cache. If conditions
* for uploading are not met, the function does nothing and returns false.
*
* This function uses the `checkout_path` input to determine the repository path
* This function uses the `checkoutPath` to determine the repository path
* and works only when called from `analyze` or `upload-sarif`.
*
* @param codeql The CodeQL instance
* @param config The configuration object
* @param logger The logger instance
* @param checkoutPath The path at which the repository is checked out at.
* @returns A promise that resolves to true if the upload was performed and
* successfully completed, or false otherwise
*/
@@ -120,6 +117,7 @@ export async function cleanupAndUploadOverlayBaseDatabaseToCache(
codeql: CodeQL,
config: Config,
logger: Logger,
checkoutPath: string,
): Promise<boolean> {
const overlayDatabaseMode = config.overlayDatabaseMode;
if (overlayDatabaseMode !== OverlayDatabaseMode.OverlayBase) {
@@ -180,7 +178,6 @@ export async function cleanupAndUploadOverlayBaseDatabaseToCache(
}
const codeQlVersion = (await codeql.getVersion()).version;
const checkoutPath = getRequiredInput("checkout_path");
const cacheSaveKey = await getCacheSaveKey(
config,
codeQlVersion,

View File

@@ -0,0 +1,175 @@
import test from "ava";
import { ActionsEnvVars } from "./environment";
import { Feature } from "./feature-flags";
import { BuiltInLanguage } from "./languages";
import {
getPerLanguageBundleLanguage,
MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION,
PerLanguageBundleOptions,
} from "./per-language-bundles";
import { BundlePlatform } from "./platform";
import {
createFeatures,
getRecordingLogger,
getTestEnv,
initAllState,
LoggedMessage,
} from "./testing-utils";
import { GitHubVariant } from "./util";
/** Options for which we would use a per-language bundle. */
const ELIGIBLE_OPTIONS: PerLanguageBundleOptions = {
rawLanguages: ["java"],
// Any version at least as new as the minimum will do.
cliVersion: MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION,
compressionMethod: "zstd",
platform: BundlePlatform.Linux64,
variant: GitHubVariant.DOTCOM,
};
async function checkEligibility(
overrides: Partial<PerLanguageBundleOptions>,
stateOverrides: Partial<ReturnType<typeof initAllState>> = {},
) {
return getPerLanguageBundleLanguage(
initAllState({
env: getTestEnv({
[ActionsEnvVars.RUNNER_ENVIRONMENT]: "github-hosted",
}),
features: createFeatures([Feature.PerLanguageBundles]),
...stateOverrides,
}),
{ ...ELIGIBLE_OPTIONS, ...overrides },
);
}
for (const platform of Object.values(BundlePlatform)) {
test(`getPerLanguageBundleLanguage selects only supported languages on ${platform}`, async (t) => {
for (const language of Object.values(BuiltInLanguage)) {
const supported =
language === BuiltInLanguage.swift
? platform === BundlePlatform.Osx64
: platform === BundlePlatform.Linux64;
t.is(
await checkEligibility({ rawLanguages: [language], platform }),
supported ? language : undefined,
language,
);
}
});
}
test("getPerLanguageBundleLanguage normalizes aliases before selecting a bundle", async (t) => {
t.is(
await checkEligibility({ rawLanguages: ["java-kotlin"] }),
BuiltInLanguage.java,
);
});
test("getPerLanguageBundleLanguage rejects unknown platforms", async (t) => {
t.is(await checkEligibility({ platform: undefined }), undefined);
});
test("getPerLanguageBundleLanguage requires exactly one language", async (t) => {
t.is(await checkEligibility({ rawLanguages: undefined }), undefined);
t.is(await checkEligibility({ rawLanguages: [] }), undefined);
t.is(await checkEligibility({ rawLanguages: ["java", "python"] }), undefined);
});
test("getPerLanguageBundleLanguage requires a known language", async (t) => {
t.is(await checkEligibility({ rawLanguages: ["cobol"] }), undefined);
});
test("getPerLanguageBundleLanguage requires a zstd bundle", async (t) => {
t.is(await checkEligibility({ compressionMethod: "gzip" }), undefined);
});
test("getPerLanguageBundleLanguage requires GitHub.com", async (t) => {
// Other products resolve the combined bundle against their own instance, so asking for a
// per-language bundle they do not mirror would move the download off that instance.
for (const variant of [GitHubVariant.GHES, GitHubVariant.GHEC_DR]) {
t.is(await checkEligibility({ variant }), undefined);
}
});
test("getPerLanguageBundleLanguage requires a GitHub-hosted runner", async (t) => {
// A self-hosted runner may have a toolcache that persists between jobs, which is worth more than
// a smaller download.
t.is(
await checkEligibility(
{},
{
env: getTestEnv({ [ActionsEnvVars.RUNNER_ENVIRONMENT]: "self-hosted" }),
},
),
undefined,
);
// Self-hosted runners are routinely configured to look like hosted ones, for example by mounting
// a persistent volume at `/opt/hostedtoolcache`, so we require the service to tell us explicitly.
t.is(
await checkEligibility(
{},
{
env: getTestEnv({ RUNNER_TOOL_CACHE: "/opt/hostedtoolcache" }),
},
),
undefined,
);
});
test("getPerLanguageBundleLanguage requires a supported release version", async (t) => {
t.is(await checkEligibility({ cliVersion: undefined }), undefined);
t.is(await checkEligibility({ cliVersion: "2.27.0" }), undefined);
t.is(await checkEligibility({ cliVersion: "2.27.1" }), BuiltInLanguage.java);
});
test("getPerLanguageBundleLanguage requires the feature flag", async (t) => {
t.is(await checkEligibility({}, { features: createFeatures([]) }), undefined);
});
test("getPerLanguageBundleLanguage explains a disabled feature before checking eligibility", async (t) => {
const messages: LoggedMessage[] = [];
const language = await getPerLanguageBundleLanguage(
initAllState({
features: createFeatures([]),
logger: getRecordingLogger(messages, { logToConsole: false }),
}),
{ ...ELIGIBLE_OPTIONS, rawLanguages: undefined, cliVersion: undefined },
);
t.is(language, undefined);
t.deepEqual(
messages.map((message) => message.message),
[
"Not using a per-language CodeQL bundle since the per_language_bundles feature is disabled.",
],
);
});
test("getPerLanguageBundleLanguage skips only the release version check for the latest nightly", async (t) => {
const nightly = { isLatestNightly: true, cliVersion: undefined };
t.is(await checkEligibility(nightly), BuiltInLanguage.java);
for (const overrides of [
{ rawLanguages: undefined },
{ rawLanguages: ["java", "python"] },
{ compressionMethod: "gzip" as const },
{ platform: BundlePlatform.Osx64 },
{ variant: GitHubVariant.GHES },
{ variant: GitHubVariant.GHEC_DR },
]) {
t.is(await checkEligibility({ ...nightly, ...overrides }), undefined);
}
t.is(
await checkEligibility(nightly, { features: createFeatures([]) }),
undefined,
);
t.is(
await checkEligibility(nightly, {
env: getTestEnv({ [ActionsEnvVars.RUNNER_ENVIRONMENT]: "self-hosted" }),
}),
undefined,
);
});

133
src/per-language-bundles.ts Normal file
View File

@@ -0,0 +1,133 @@
import * as semver from "semver";
import { ActionState } from "./action-common";
import { isGitHubHostedRunner } from "./actions-util";
import { Feature } from "./feature-flags";
import { BuiltInLanguage, parseBuiltInLanguage } from "./languages";
import { BundlePlatform } from "./platform";
import * as tar from "./tar";
import { GitHubVariant } from "./util";
/** Minimum CLI version for selecting a per-language release bundle. */
export const MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION = "2.27.1";
/** Languages with per-language bundles published for each platform. */
const PER_LANGUAGE_BUNDLE_LANGUAGES: Readonly<
Record<BundlePlatform, ReadonlySet<BuiltInLanguage>>
> = {
[BundlePlatform.Linux64]: new Set([
BuiltInLanguage.actions,
BuiltInLanguage.cpp,
BuiltInLanguage.csharp,
BuiltInLanguage.go,
BuiltInLanguage.java,
BuiltInLanguage.javascript,
BuiltInLanguage.python,
BuiltInLanguage.ruby,
BuiltInLanguage.rust,
]),
[BundlePlatform.LinuxArm64]: new Set(),
[BundlePlatform.Osx64]: new Set([BuiltInLanguage.swift]),
[BundlePlatform.Win64]: new Set(),
};
/** Inputs that determine whether we may download a per-language bundle. */
export interface PerLanguageBundleOptions {
/** Explicit input only: autodetection needs a CLI instance. */
rawLanguages: string[] | undefined;
/** Requested CLI version, if known. Ignored when requesting the latest nightly. */
cliVersion: string | undefined;
compressionMethod: tar.CompressionMethod;
/** Platform for which the bundle is requested. */
platform: BundlePlatform | undefined;
variant: GitHubVariant;
/** Whether the Action is selecting the latest nightly rather than a release version. */
isLatestNightly?: boolean;
}
/** Returns the eligible bundle language, or undefined for the combined bundle. */
export async function getPerLanguageBundleLanguage(
{
env,
features,
logger,
}: ActionState<["Logger", "ReadOnlyEnv", "FeatureFlags"]>,
options: PerLanguageBundleOptions,
): Promise<BuiltInLanguage | undefined> {
const {
rawLanguages,
cliVersion,
compressionMethod,
platform,
variant,
isLatestNightly,
} = options;
const explain = (reason: string) => {
logger.debug(`Not using a per-language CodeQL bundle since ${reason}.`);
return undefined;
};
if (!(await features.getValue(Feature.PerLanguageBundles))) {
return explain(`the ${Feature.PerLanguageBundles} feature is disabled`);
}
if (rawLanguages?.length !== 1) {
return explain(
`exactly one language must be requested via the 'languages' input, but ${
rawLanguages?.length ?? 0
} were`,
);
}
const language = parseBuiltInLanguage(rawLanguages[0]);
if (language === undefined) {
return explain(`'${rawLanguages[0]}' is not a known CodeQL language`);
}
if (compressionMethod !== "zstd") {
// Per-language bundles are only published as zstd archives.
return explain(`the bundle would be downloaded as '${compressionMethod}'`);
}
if (variant !== GitHubVariant.DOTCOM) {
// Tenant mirrors may lack these assets, and an unreachable github.com fails with a
// connection error rather than a recoverable 404.
return explain(`we are running against ${variant}`);
}
if (!isGitHubHostedRunner(env)) {
// Per-language installs stay out of the toolcache; self-hosted runners should retain
// the reusable combined bundle instead.
return explain("the job is not running on a GitHub-hosted runner");
}
// Nightly releases are identified by dates rather than versions. If
// `isLatestNightly` is `true`, the latest nightly is requested with
// `tools: nightly` and we don't yet have the corresponding tag at this point.
// Therefore, we skip the version check and don't have an equivalent.
// We can safely assume that the latest nightly will have per-language bundles.
if (!isLatestNightly) {
if (cliVersion === undefined) {
return explain("the requested CLI version is unknown");
}
if (!semver.gte(cliVersion, MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION)) {
return explain(
`the requested CodeQL version ${cliVersion} is older than ${MIN_PER_LANGUAGE_BUNDLE_CLI_VERSION}, which is the ` +
"first version for which per-language bundles are published",
);
}
}
if (
platform === undefined ||
!PER_LANGUAGE_BUNDLE_LANGUAGES[platform].has(language)
) {
return explain(
`no per-language bundle is published for ${language} on ${platform ?? "an unknown platform"}`,
);
}
return language;
}

18
src/platform.test.ts Normal file
View File

@@ -0,0 +1,18 @@
import test from "ava";
import { BundlePlatform, getBundlePlatform } from "./platform";
for (const [platform, arch, expected] of [
["linux", "x64", BundlePlatform.Linux64],
["linux", "arm64", BundlePlatform.LinuxArm64],
["linux", "ia32", BundlePlatform.Linux64],
["darwin", "x64", BundlePlatform.Osx64],
["darwin", "arm64", BundlePlatform.Osx64],
["win32", "x64", BundlePlatform.Win64],
["win32", "arm64", BundlePlatform.Win64],
["freebsd", "x64", undefined],
] as const) {
test(`getBundlePlatform maps ${platform}/${arch} to ${expected ?? "an all-platform bundle"}`, (t) => {
t.is(getBundlePlatform(platform, arch), expected);
});
}

26
src/platform.ts Normal file
View File

@@ -0,0 +1,26 @@
/** Platform identifiers used in CodeQL bundle asset names. */
export enum BundlePlatform {
Linux64 = "linux64",
LinuxArm64 = "linux-arm64",
Osx64 = "osx64",
Win64 = "win64",
}
/** Returns the bundle platform, or undefined when an all-platform bundle is required. */
export function getBundlePlatform(
platform: NodeJS.Platform = process.platform,
arch: NodeJS.Architecture = process.arch,
): BundlePlatform | undefined {
switch (platform) {
case "win32":
return BundlePlatform.Win64;
case "linux":
return arch === "arm64"
? BundlePlatform.LinuxArm64
: BundlePlatform.Linux64;
case "darwin":
return BundlePlatform.Osx64;
default:
return undefined;
}
}

View File

@@ -12,7 +12,7 @@ import { getGitHubVersion } from "./api-client";
import { CodeQL } from "./codeql";
import { ComputedInput, getToolsInput } from "./config/inputs";
import { getRawLanguagesNoAutodetect } from "./config-utils";
import { EnvVar } from "./environment";
import { ActionsEnvVars, EnvVar } from "./environment";
import { initFeatures } from "./feature-flags";
import { loadRepositoryProperties } from "./feature-flags/properties";
import { initCodeQL } from "./init";
@@ -22,17 +22,16 @@ import { ToolsSource } from "./setup-codeql";
import {
ActionName,
InitStatusReport,
InitToolsDownloadFields,
createStatusReportBase,
getActionsStatus,
sendStatusReport,
} from "./status-report";
import { createInitToolsDownloadFields } from "./status-report/tools-download";
import { ToolsDownloadStatusReport } from "./tools-download";
import {
checkDiskUsage,
checkForTimeout,
checkGitHubVersionInRange,
getRequiredEnvParam,
initializeEnvironment,
ConfigurationError,
wrapError,
@@ -79,23 +78,10 @@ async function sendCompletedStatusReport(
initStatusReport.computed_inputs.tools = toolsInput;
}
const initToolsDownloadFields: InitToolsDownloadFields = {};
if (toolsDownloadStatusReport?.downloadDurationMs !== undefined) {
initToolsDownloadFields.tools_download_duration_ms =
toolsDownloadStatusReport.downloadDurationMs;
}
if (toolsDownloadStatusReport?.extractionDurationMs !== undefined) {
initToolsDownloadFields.tools_extraction_duration_ms =
toolsDownloadStatusReport.extractionDurationMs;
}
if (toolsDownloadStatusReport?.totalDurationMs !== undefined) {
initToolsDownloadFields.tools_total_duration_ms =
toolsDownloadStatusReport.totalDurationMs;
}
if (toolsFeatureFlagsValid !== undefined) {
initToolsDownloadFields.tools_feature_flags_valid = toolsFeatureFlagsValid;
}
const initToolsDownloadFields = createInitToolsDownloadFields(
toolsDownloadStatusReport,
toolsFeatureFlagsValid,
);
await sendStatusReport({ ...initStatusReport, ...initToolsDownloadFields });
}
@@ -121,8 +107,8 @@ async function run(
const apiDetails = {
auth: getRequiredInput("token"),
externalRepoAuth: getOptionalInput("external-repository-token"),
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
apiURL: getRequiredEnvParam("GITHUB_API_URL"),
url: actionState.env.getRequired(ActionsEnvVars.GITHUB_SERVER_URL),
apiURL: actionState.env.getRequired(ActionsEnvVars.GITHUB_API_URL),
};
const gitHubVersion = await getGitHubVersion();

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,7 @@
import * as fs from "fs";
import { OutgoingHttpHeaders } from "http";
import * as path from "path";
import { performance } from "perf_hooks";
import * as core from "@actions/core";
import * as toolcache from "@actions/tool-cache";
@@ -16,6 +17,7 @@ import {
isRunningLocalAction,
} from "./actions-util";
import * as api from "./api-client";
import { CodeQLBundle, getCodeQLBundleFromUrl } from "./codeql-bundle";
import * as defaults from "./defaults.json";
import {
addNoLanguageDiagnostic,
@@ -30,8 +32,11 @@ import {
Feature,
FeatureEnablement,
} from "./feature-flags";
import { BuiltInLanguage } from "./languages";
import { Logger } from "./logging";
import { getCodeQlVersionsForOverlayBaseDatabases } from "./overlay/caching";
import { getPerLanguageBundleLanguage } from "./per-language-bundles";
import { getBundlePlatform } from "./platform";
import * as tar from "./tar";
import {
deleteToolcacheBundles,
@@ -72,21 +77,25 @@ function getCodeQLBundleExtension(
}
}
/**
* Returns the name of the CodeQL bundle asset to download.
*
* @param compressionMethod The compression method of the bundle.
* @param language Optional language for a per-language bundle. If omitted, returns a combined bundle name.
*/
export function getCodeQLBundleName(
compressionMethod: tar.CompressionMethod,
language?: BuiltInLanguage,
): string {
const extension = getCodeQLBundleExtension(compressionMethod);
const platform = getBundlePlatform();
let platform: string;
if (process.platform === "win32") {
platform = "win64";
} else if (process.platform === "linux") {
platform = process.arch === "arm64" ? "linux-arm64" : "linux64";
} else if (process.platform === "darwin") {
platform = "osx64";
} else {
if (platform === undefined) {
return `codeql-bundle${extension}`;
}
if (language !== undefined) {
return `codeql-bundle-${language}-${platform}${extension}`;
}
return `codeql-bundle-${platform}${extension}`;
}
@@ -107,7 +116,7 @@ export function getCodeQLActionRepository(logger: Logger): string {
async function getCodeQLBundleDownloadURL(
tagName: string,
apiDetails: api.GitHubApiDetails,
compressionMethod: tar.CompressionMethod,
codeQLBundleName: string,
logger: Logger,
): Promise<string> {
const codeQLActionRepository = getCodeQLActionRepository(logger);
@@ -126,7 +135,6 @@ async function getCodeQLBundleDownloadURL(
return !self.slice(0, index).some((other) => deepEqual(source, other));
},
);
const codeQLBundleName = getCodeQLBundleName(compressionMethod);
for (const downloadSource of uniqueDownloadSources) {
const [apiURL, repository] = downloadSource;
// If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
@@ -164,7 +172,7 @@ function tryGetBundleVersionFromTagName(
tagName: string,
logger: Logger,
): string | undefined {
const match = tagName.match(/^codeql-bundle-(.*)$/);
const match = tagName.match(/^codeql-bundle-(.+)$/);
if (match === null || match.length < 2) {
logger.debug(`Could not determine bundle version from tag ${tagName}.`);
return undefined;
@@ -215,6 +223,22 @@ export function convertToSemVer(version: string, logger: Logger): string {
return s;
}
/** A resolved download, including its bundle identity and version. */
export interface CodeQLDownloadSource {
/** Distinguishes downloads from local archives and cached installations. */
sourceType: "download";
/** The bundle to download. */
bundle: CodeQLBundle;
/** The compression format of the bundle archive. */
compressionMethod: tar.CompressionMethod;
/** Bundle version of the tools, if known. */
bundleVersion?: string;
/** Requested CLI version, if known. */
cliVersion?: string;
/** Resolved version for telemetry, independent of whether the bundle can be cached. */
toolsVersion: string;
}
export type CodeQLToolsSource =
| {
codeqlTarPath: string;
@@ -229,17 +253,7 @@ export type CodeQLToolsSource =
/** Human-readable description of the source of the tools for telemetry purposes. */
toolsVersion: string;
}
| {
/** Bundle version of the tools, if known. */
bundleVersion?: string;
/** CLI version of the tools, if known. */
cliVersion?: string;
compressionMethod: tar.CompressionMethod;
codeqlURL: string;
sourceType: "download";
/** Human-readable description of the source of the tools for telemetry purposes. */
toolsVersion: string;
};
| CodeQLDownloadSource;
/**
* Look for a version of the CodeQL tools in the cache which could override the requested CLI version.
@@ -448,7 +462,7 @@ export async function getCodeQLSource(
};
}
/** CLI version number, for example 2.12.6. */
/** Requested CLI version number, for example 2.12.6. */
let cliVersion: string | undefined;
/** Tag name of the CodeQL bundle, for example `codeql-bundle-20230120`. */
let tagName: string | undefined;
@@ -458,6 +472,7 @@ export async function getCodeQLSource(
* This does not always include a tag name.
*/
let url: string | undefined;
let bundle: CodeQLBundle | undefined;
// We allow forcing the nightly CLI via the FF for `dynamic` events (or in test mode) where the
// `tools` input cannot be adjusted to explicitly request it.
@@ -466,7 +481,8 @@ export async function getCodeQLSource(
const forceNightly = forceNightlyValueFF && canForceNightlyWithFF;
// For advanced workflows, a value from `CODEQL_NIGHTLY_TOOLS_INPUTS` can be specified explicitly
// for the `tools` input in the workflow file.
// for the `tools` input. This is the computed input, so it may come from the repository property
// rather than the workflow file.
const nightlyRequestedByToolsInput =
toolsInput !== undefined &&
CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput);
@@ -500,7 +516,12 @@ export async function getCodeQLSource(
`Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.`,
);
}
toolsInput = await getNightlyToolsUrl(logger);
bundle = await getLatestNightlyBundle(
{ env: getEnv(), features, logger },
rawLanguages,
variant,
);
toolsInput = bundle.url;
}
/**
@@ -583,7 +604,7 @@ export async function getCodeQLSource(
if (tagName) {
const bundleVersion = tryGetBundleVersionFromTagName(tagName, logger);
// If the bundle version is a semantic version, it is a CLI version number.
if (bundleVersion && semver.valid(bundleVersion)) {
if (bundleVersion !== undefined && semver.valid(bundleVersion)) {
cliVersion = convertToSemVer(bundleVersion, logger);
}
}
@@ -600,13 +621,15 @@ export async function getCodeQLSource(
}
const bundleVersion =
tagName && tryGetBundleVersionFromTagName(tagName, logger);
const humanReadableVersion =
tagName !== undefined
? tryGetBundleVersionFromTagName(tagName, logger)
: undefined;
const resolvedVersion =
cliVersion ??
(bundleVersion && convertToSemVer(bundleVersion, logger)) ??
tagName ??
url ??
"unknown";
(bundleVersion !== undefined
? convertToSemVer(bundleVersion, logger)
: undefined);
const humanReadableVersion = resolvedVersion ?? tagName ?? url ?? "unknown";
logger.debug(
"Attempting to obtain CodeQL tools. " +
@@ -721,18 +744,55 @@ export async function getCodeQLSource(
let compressionMethod: tar.CompressionMethod;
if (!url) {
const bundleTagName = tagName;
if (bundleTagName === undefined) {
throw new Error(
"Could not determine a release tag for the requested CodeQL bundle.",
);
}
compressionMethod =
cliVersion !== undefined &&
(await useZstdBundle(cliVersion, tarSupportsZstd))
? "zstd"
: "gzip";
url = await getCodeQLBundleDownloadURL(
tagName!,
apiDetails,
compressionMethod,
logger,
const perLanguageBundleLanguage = await getPerLanguageBundleLanguage(
{ env: getEnv(), features, logger },
{
rawLanguages,
cliVersion,
compressionMethod,
platform: getBundlePlatform(),
variant,
},
);
// Resolves the combined or per-language bundle URL for the requested release.
const resolveBundleURL = (language?: BuiltInLanguage) =>
getCodeQLBundleDownloadURL(
bundleTagName,
apiDetails,
getCodeQLBundleName(compressionMethod, language),
logger,
);
const combinedBundleURL = await resolveBundleURL();
if (perLanguageBundleLanguage !== undefined) {
logger.info(
`Selected the per-language CodeQL bundle for '${perLanguageBundleLanguage}'.`,
);
url = await resolveBundleURL(perLanguageBundleLanguage);
bundle = {
kind: "per-language",
url,
language: perLanguageBundleLanguage,
combinedBundleURL,
};
} else {
url = combinedBundleURL;
bundle = { kind: "combined", url };
}
} else {
const method = tar.inferCompressionMethod(url);
if (method === undefined) {
@@ -742,6 +802,13 @@ export async function getCodeQLSource(
);
}
compressionMethod = method;
bundle ??= getCodeQLBundleFromUrl(url);
if (bundle.kind === "per-language") {
logger.info(
`${url} appears to be a CodeQL bundle that contains only ${bundle.language}.`,
);
}
}
if (cliVersion) {
@@ -750,12 +817,12 @@ export async function getCodeQLSource(
logger.info(`Using CodeQL CLI sourced from ${url} .`);
}
return {
bundleVersion: tagName && tryGetBundleVersionFromTagName(tagName, logger),
bundle,
bundleVersion,
cliVersion,
codeqlURL: url,
compressionMethod,
sourceType: "download",
toolsVersion: cliVersion ?? humanReadableVersion,
toolsVersion: resolvedVersion ?? "unknown",
};
}
@@ -769,7 +836,7 @@ async function tryGetFallbackToolcacheVersion(
logger: Logger,
): Promise<string | undefined> {
const bundleVersion = tryGetBundleVersionFromTagName(tagName, logger);
if (!bundleVersion) {
if (bundleVersion === undefined) {
return undefined;
}
const fallbackVersion = convertToSemVer(bundleVersion, logger);
@@ -783,20 +850,17 @@ async function tryGetFallbackToolcacheVersion(
// Exported using `export const` for testing purposes. Specifically, we want to
// be able to stub this function and have other functions in this file use that stub.
export const downloadCodeQL = async function (
codeqlURL: string,
compressionMethod: tar.CompressionMethod,
maybeBundleVersion: string | undefined,
maybeCliVersion: string | undefined,
source: CodeQLDownloadSource,
apiDetails: api.GitHubApiDetails,
tarVersion: tar.TarVersion | undefined,
tempDir: string,
features: FeatureEnablement,
logger: Logger,
): Promise<{
codeqlFolder: string;
statusReport: ToolsDownloadStatusReport;
toolsVersion: string;
}> {
const { bundle, compressionMethod } = source;
const codeqlURL = bundle.url;
const parsedCodeQLURL = new URL(codeqlURL);
const searchParams = new URLSearchParams(parsedCodeQLURL.search);
const headers: OutgoingHttpHeaders = {
@@ -815,17 +879,11 @@ export const downloadCodeQL = async function (
);
}
const toolcacheInfo = getToolcacheDestinationInfo(
maybeBundleVersion,
maybeCliVersion,
logger,
const toolcacheDestination = getToolcacheDestination({ logger }, source);
const extractedBundlePath = toolcacheDestination.orElse(
getTempExtractionDir(tempDir),
);
const extractedBundlePath =
toolcacheInfo?.path ?? getTempExtractionDir(tempDir);
await tryDeleteToolcacheBundles({ env: getEnv(), features, logger });
const statusReport = await downloadAndExtract(
codeqlURL,
compressionMethod,
@@ -836,46 +894,53 @@ export const downloadCodeQL = async function (
logger,
);
if (!toolcacheInfo) {
logger.debug(
"Could not cache CodeQL tools because we could not determine the bundle version from the " +
`URL ${codeqlURL}.`,
);
return {
codeqlFolder: extractedBundlePath,
statusReport,
toolsVersion: maybeCliVersion ?? "unknown",
};
if (toolcacheDestination.isSuccess()) {
writeToolcacheMarkerFile(toolcacheDestination.value, logger);
} else {
logger.debug(toolcacheDestination.value);
}
writeToolcacheMarkerFile(toolcacheInfo.path, logger);
return {
codeqlFolder: extractedBundlePath,
statusReport,
toolsVersion: maybeCliVersion ?? toolcacheInfo.version,
statusReport:
bundle.kind === "per-language"
? {
...statusReport,
perLanguage: { tools_bundle_language: bundle.language },
}
: statusReport,
};
};
function getToolcacheDestinationInfo(
maybeBundleVersion: string | undefined,
maybeCliVersion: string | undefined,
logger: Logger,
): { path: string; version: string } | undefined {
if (maybeBundleVersion) {
const version = getCanonicalToolcacheVersion(
maybeCliVersion,
maybeBundleVersion,
logger,
/**
* Returns the canonical toolcache directory, or the reason the bundle cannot be cached.
*/
function getToolcacheDestination(
{ logger }: ActionState<["Logger"]>,
source: CodeQLDownloadSource,
): util.Result<string, string> {
if (source.bundle.kind !== "combined") {
return new util.Failure(
"Not caching the CodeQL tools because they came from a bundle that contains only a " +
"single language.",
);
}
if (!source.bundleVersion) {
return new util.Failure(
"Could not cache CodeQL tools because we could not determine the bundle version from the " +
`URL ${source.bundle.url}.`,
);
return {
path: getToolcacheDirectory(version),
version,
};
}
return undefined;
return new util.Success(
getToolcacheDirectory(
getCanonicalToolcacheVersion(
source.cliVersion,
source.bundleVersion,
logger,
),
),
);
}
/**
@@ -1000,7 +1065,6 @@ export async function setupCodeQLBundle(
);
let codeqlFolder: string;
let toolsVersion = source.toolsVersion;
let toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined;
let toolsSource: ToolsSource;
switch (source.sourceType) {
@@ -1021,18 +1085,13 @@ export async function setupCodeQLBundle(
toolsSource = ToolsSource.Toolcache;
break;
case "download": {
const result = await downloadCodeQL(
source.codeqlURL,
source.compressionMethod,
source.bundleVersion,
source.cliVersion,
const result = await downloadCodeQLBundle(
{ env: getEnv(), features, logger },
source,
apiDetails,
zstdAvailability.version,
tempDir,
features,
logger,
);
toolsVersion = result.toolsVersion;
codeqlFolder = result.codeqlFolder;
toolsDownloadStatusReport = result.statusReport;
toolsSource = ToolsSource.Download;
@@ -1050,10 +1109,77 @@ export async function setupCodeQLBundle(
codeqlFolder,
toolsDownloadStatusReport,
toolsSource,
toolsVersion,
toolsVersion: source.toolsVersion,
};
}
/**
* Performs eligible toolcache cleanup once, then downloads and extracts the resolved bundle.
*
* If an automatically selected per-language bundle is missing, downloads the combined bundle
* from the same release instead. Explicit bundle URLs are not substituted.
*
* @returns The extraction directory and download timings.
*/
export async function downloadCodeQLBundle(
action: ActionState<["Logger", "ReadOnlyEnv", "FeatureFlags"]>,
source: CodeQLDownloadSource,
apiDetails: api.GitHubApiDetails,
tarVersion: tar.TarVersion | undefined,
tempDir: string,
): Promise<{
codeqlFolder: string;
statusReport: ToolsDownloadStatusReport;
}> {
const { bundle } = source;
const { logger } = action;
await tryDeleteToolcacheBundles(action);
const startTime = performance.now();
try {
return await downloadCodeQL(
source,
apiDetails,
tarVersion,
tempDir,
logger,
);
} catch (e) {
if (
bundle.kind !== "per-language" ||
bundle.combinedBundleURL === undefined ||
util.asHTTPError(e)?.status !== 404
) {
throw e;
}
logger.warning(
`No per-language CodeQL bundle for '${bundle.language}' was found at ${bundle.url}, so ` +
"falling back to the bundle that contains all languages. This analysis will still " +
"produce correct results, but will take longer to set up.",
);
const result = await downloadCodeQL(
{
...source,
bundle: { kind: "combined", url: bundle.combinedBundleURL },
},
apiDetails,
tarVersion,
tempDir,
logger,
);
return {
...result,
statusReport: {
...result.statusReport,
totalDurationMs: util.durationMsSince(startTime),
perLanguage: { tools_per_language_bundle_fallback: true },
},
};
}
}
async function useZstdBundle(
cliVersion: string,
tarSupportsZstd: boolean,
@@ -1071,9 +1197,15 @@ function getTempExtractionDir(tempDir: string) {
}
/**
* Get the URL of the latest nightly CodeQL bundle.
* Selects a bundle from the latest nightly release, preferring a per-language bundle when eligible.
* Records the combined bundle URL from that release for use if the selected asset is missing.
*/
async function getNightlyToolsUrl(logger: Logger) {
async function getLatestNightlyBundle(
action: ActionState<["Logger", "ReadOnlyEnv", "FeatureFlags"]>,
rawLanguages: string[] | undefined,
variant: util.GitHubVariant,
): Promise<CodeQLBundle> {
const { logger } = action;
const zstdAvailability = await tar.isZstdAvailable(logger);
// The nightly is guaranteed to have a zstd bundle
const compressionMethod = (await useZstdBundle(
@@ -1083,6 +1215,15 @@ async function getNightlyToolsUrl(logger: Logger) {
? "zstd"
: "gzip";
const language = await getPerLanguageBundleLanguage(action, {
rawLanguages,
cliVersion: undefined,
compressionMethod,
platform: getBundlePlatform(),
variant,
isLatestNightly: true,
});
try {
// Since nightlies are prereleases, we can't just download the latest release
// on the repository. So instead we need to find the latest pre-release
@@ -1098,7 +1239,17 @@ async function getNightlyToolsUrl(logger: Logger) {
if (!latestRelease) {
throw new Error("Could not find the latest nightly release.");
}
return `https://github.com/${CODEQL_NIGHTLIES_REPOSITORY_OWNER}/${CODEQL_NIGHTLIES_REPOSITORY_NAME}/releases/download/${latestRelease.tag_name}/${getCodeQLBundleName(compressionMethod)}`;
const assetUrl = (name: string) =>
`https://github.com/${CODEQL_NIGHTLIES_REPOSITORY_OWNER}/${CODEQL_NIGHTLIES_REPOSITORY_NAME}/releases/download/${latestRelease.tag_name}/${name}`;
const url = assetUrl(getCodeQLBundleName(compressionMethod, language));
return language === undefined
? { kind: "combined", url }
: {
kind: "per-language",
url,
language,
combinedBundleURL: assetUrl(getCodeQLBundleName(compressionMethod)),
};
} catch (e) {
throw new Error(
`Failed to retrieve the latest nightly release: ${util.wrapError(e)}`,

View File

@@ -624,29 +624,6 @@ export interface InitWithConfigStatusReport extends InitStatusReport {
config_file: string;
}
/** Fields of the init status report populated when the tools source is `download`. */
export interface InitToolsDownloadFields {
/**
* Time taken to download the bundle, in milliseconds. Not populated when the bundle is downloaded
* and extracted concurrently.
*/
tools_download_duration_ms?: number;
/**
* Time taken to extract the bundle, in milliseconds. Not populated when the bundle is downloaded
* and extracted concurrently.
*/
tools_extraction_duration_ms?: number;
/**
* Total time taken to make the bundle available on disk, in milliseconds. This includes any time
* spent on a streaming attempt that failed and fell back to downloading before extracting.
*/
tools_total_duration_ms?: number;
/**
* Whether the relevant tools dotcom feature flags have been misconfigured.
* Only populated if we attempt to determine the default version based on the dotcom feature flags. */
tools_feature_flags_valid?: boolean;
}
/**
* Composes a `InitWithConfigStatusReport` from the given values.
*

View File

@@ -0,0 +1,80 @@
import test from "ava";
import { BuiltInLanguage } from "../languages";
import { createInitToolsDownloadFields } from "./tools-download";
test("createInitToolsDownloadFields omits absent download data", (t) => {
t.deepEqual(createInitToolsDownloadFields(undefined, undefined), {});
});
test("createInitToolsDownloadFields reports feature flags without a download", (t) => {
t.deepEqual(createInitToolsDownloadFields(undefined, false), {
tools_feature_flags_valid: false,
});
});
test("createInitToolsDownloadFields reports only the total for a streaming download", (t) => {
t.deepEqual(
createInitToolsDownloadFields({ totalDurationMs: 300 }, undefined),
{ tools_total_duration_ms: 300 },
);
});
test("createInitToolsDownloadFields preserves per-language metadata", (t) => {
t.deepEqual(
createInitToolsDownloadFields(
{
totalDurationMs: 300,
perLanguage: { tools_bundle_language: BuiltInLanguage.java },
},
true,
),
{
tools_total_duration_ms: 300,
tools_bundle_language: BuiltInLanguage.java,
tools_feature_flags_valid: true,
},
);
});
test("createInitToolsDownloadFields preserves fallback and per-attempt timings", (t) => {
t.deepEqual(
createInitToolsDownloadFields(
{
downloadDurationMs: 200,
extractionDurationMs: 100,
totalDurationMs: 1000,
perLanguage: { tools_per_language_bundle_fallback: true },
},
undefined,
),
{
tools_download_duration_ms: 200,
tools_extraction_duration_ms: 100,
tools_total_duration_ms: 1000,
tools_per_language_bundle_fallback: true,
},
);
});
test("createInitToolsDownloadFields preserves zero durations and false flags", (t) => {
t.deepEqual(
createInitToolsDownloadFields(
{
downloadDurationMs: 0,
extractionDurationMs: 0,
totalDurationMs: 0,
perLanguage: { tools_per_language_bundle_fallback: false },
},
false,
),
{
tools_download_duration_ms: 0,
tools_extraction_duration_ms: 0,
tools_total_duration_ms: 0,
tools_per_language_bundle_fallback: false,
tools_feature_flags_valid: false,
},
);
});

View File

@@ -0,0 +1,56 @@
import type { ToolsDownloadStatusReport } from "../tools-download";
/** Telemetry describing per-language bundle downloads. */
export interface PerLanguageToolsStatusReport {
/** The language of the single-language bundle that was downloaded, if any. */
tools_bundle_language?: string;
/**
* Whether we tried to download a single-language bundle, but it did not exist and we fell back to
* the combined bundle.
*/
tools_per_language_bundle_fallback?: boolean;
}
/** Fields of the init status report populated when the tools source is `download`. */
export interface InitToolsDownloadFields extends PerLanguageToolsStatusReport {
/**
* Time taken to download the bundle, in milliseconds. Not populated when the bundle is downloaded
* and extracted concurrently.
*/
tools_download_duration_ms?: number;
/**
* Time taken to extract the bundle, in milliseconds. Not populated when the bundle is downloaded
* and extracted concurrently.
*/
tools_extraction_duration_ms?: number;
/**
* Total time taken to make the bundle available on disk, including failed download attempts
* before a fallback, in milliseconds.
*/
tools_total_duration_ms?: number;
/**
* Whether the relevant tools dotcom feature flags have been misconfigured.
* Only populated if we attempt to determine the default version based on the dotcom feature flags. */
tools_feature_flags_valid?: boolean;
}
/** Converts download results to telemetry fields shared by the init and setup-codeql Actions. */
export function createInitToolsDownloadFields(
report: ToolsDownloadStatusReport | undefined,
toolsFeatureFlagsValid: boolean | undefined,
): InitToolsDownloadFields {
const fields: InitToolsDownloadFields = { ...report?.perLanguage };
if (report?.downloadDurationMs !== undefined) {
fields.tools_download_duration_ms = report.downloadDurationMs;
}
if (report?.extractionDurationMs !== undefined) {
fields.tools_extraction_duration_ms = report.extractionDurationMs;
}
if (report?.totalDurationMs !== undefined) {
fields.tools_total_duration_ms = report.totalDurationMs;
}
if (toolsFeatureFlagsValid !== undefined) {
fields.tools_feature_flags_valid = toolsFeatureFlagsValid;
}
return fields;
}

View File

@@ -32,6 +32,7 @@ import {
} from "./feature-flags";
import { Logger } from "./logging";
import { OverlayDatabaseMode } from "./overlay/overlay-database-mode";
import { getBundlePlatform } from "./platform";
import { ActionName } from "./status-report";
import {
DEFAULT_DEBUG_ARTIFACT_NAME,
@@ -933,21 +934,14 @@ export function mockBundleDownloadApi({
platformSpecific?: boolean;
tagName: string;
}): string {
const platform =
process.platform === "win32"
? "win64"
: process.platform === "linux"
? process.arch === "arm64"
? "linux-arm64"
: "linux64"
: "osx64";
const platform = platformSpecific ? getBundlePlatform() : undefined;
const baseUrl = apiDetails?.url ?? "https://example.com";
const bundleUrls = ["tar.gz", "tar.zst"].map((extension) => {
const relativeUrl = apiDetails
? `/${repo}/releases/download/${tagName}/codeql-bundle${
platformSpecific ? `-${platform}` : ""
platform !== undefined ? `-${platform}` : ""
}.${extension}`
: `/download/${tagName}/codeql-bundle.${extension}`;

View File

@@ -1,8 +1,12 @@
import { once } from "events";
import * as fs from "fs";
import { ClientRequest, IncomingMessage } from "http";
import * as path from "path";
import * as core from "@actions/core";
import * as toolcache from "@actions/tool-cache";
import test from "ava";
import { https } from "follow-redirects";
import nock from "nock";
import * as sinon from "sinon";
@@ -10,14 +14,14 @@ import { getRunnerLogger } from "./logging";
import * as tar from "./tar";
import { setupTests } from "./testing-utils";
import { downloadAndExtract } from "./tools-download";
import { withTmpDir } from "./util";
import * as util from "./util";
setupTests(test);
test.serial(
"downloadAndExtract reports the durations when downloading before extracting",
async (t) => {
await withTmpDir(async (tmpDir) => {
await util.withTmpDir(async (tmpDir) => {
const archivePath = path.join(tmpDir, "codeql-bundle.tar.gz");
const destination = path.join(tmpDir, "codeql");
sinon.stub(toolcache, "downloadTool").resolves(archivePath);
@@ -43,13 +47,16 @@ test.serial(
test.serial(
"downloadAndExtract falls back to downloading before extracting if streaming fails",
async (t) => {
await withTmpDir(async (tmpDir) => {
await util.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);
.callsFake(async () => {
t.false(fs.existsSync(destination));
return archivePath;
});
const extract = sinon.stub(tar, "extract").resolves(destination);
const extractTarZst = sinon.stub(tar, "extractTarZst").resolves();
const request = nock("https://example.com")
@@ -78,10 +85,134 @@ test.serial(
},
);
test.serial(
"downloadAndExtract rethrows a 404 rather than retrying the download",
async (t) => {
await util.withTmpDir(async (tmpDir) => {
sinon.stub(process, "platform").value("linux");
const destination = path.join(tmpDir, "codeql");
const downloadTool = sinon.stub(toolcache, "downloadTool");
const extractTarZst = sinon.stub(tar, "extractTarZst").resolves();
const request = nock("https://example.com")
.get("/codeql-bundle.tar.zst")
.reply(404, "Not found");
const error = await t.throwsAsync(
downloadAndExtract(
"https://example.com/codeql-bundle.tar.zst",
"zstd",
destination,
undefined,
{},
{ type: "gnu", version: "1.34" },
getRunnerLogger(true),
),
{
instanceOf: util.HTTPError,
message:
"Failed to download CodeQL bundle from https://example.com/codeql-bundle.tar.zst. HTTP status code: 404.",
},
);
t.is(error?.status, 404);
t.true(request.isDone());
t.false(extractTarZst.called);
t.false(downloadTool.called);
t.false(fs.existsSync(destination));
});
},
);
test.serial(
"downloadAndExtract falls back to downloading before extracting on a server error",
async (t) => {
await util.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")
.callsFake(async () => {
t.false(fs.existsSync(destination));
return 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")
.reply(500);
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(
"downloadAndExtract handles an unknown status as a non-HTTP error",
async (t) => {
const asHTTPError = sinon.spy(util, "asHTTPError");
await util.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 response = sinon.createStubInstance(IncomingMessage);
response.statusCode = undefined;
sinon
.stub(https, "get")
.callsArgWith(2, response)
.returns(sinon.createStubInstance(ClientRequest));
const warning = sinon.stub(core, "warning");
const downloadTool = sinon
.stub(toolcache, "downloadTool")
.resolves(archivePath);
const extract = sinon.stub(tar, "extract").resolves(destination);
const extractTarZst = sinon.stub(tar, "extractTarZst").resolves();
await downloadAndExtract(
"https://example.com/codeql-bundle.tar.zst",
"zstd",
destination,
undefined,
{},
{ type: "gnu", version: "1.34" },
getRunnerLogger(true),
);
t.is(
warning.firstCall.args[0],
"Failed to download and extract CodeQL bundle using streaming with error: Failed to download CodeQL bundle from https://example.com/codeql-bundle.tar.zst.",
);
t.true(response.resume.calledOnce);
t.false(extractTarZst.called);
t.true(downloadTool.calledOnce);
t.true(extract.calledOnce);
});
t.true(asHTTPError.calledOnce);
t.true(asHTTPError.firstCall.args[0] instanceof Error);
t.false(asHTTPError.firstCall.args[0] instanceof util.HTTPError);
t.is(asHTTPError.firstCall.returnValue, undefined);
},
);
test.serial(
"downloadAndExtract reports only the total duration when streaming extraction",
async (t) => {
await withTmpDir(async (tmpDir) => {
await util.withTmpDir(async (tmpDir) => {
sinon.stub(process, "platform").value("linux");
const downloadTool = sinon.stub(toolcache, "downloadTool");
const extractTarZst = sinon

View File

@@ -13,8 +13,16 @@ import * as semver from "semver";
import { ActionState } from "./action-common";
import { ActionsEnvVars, getEnv, ReadOnlyEnv } from "./environment";
import { formatDuration, Logger } from "./logging";
import type { PerLanguageToolsStatusReport } from "./status-report/tools-download";
import * as tar from "./tar";
import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util";
import {
asHTTPError,
cleanUpPath,
durationMsSince,
getErrorMessage,
getRequiredEnvParam,
HTTPError,
} from "./util";
/**
* High watermark to use when streaming the download and extraction of the CodeQL tools.
@@ -44,10 +52,11 @@ export type ToolsDownloadStatusReport = {
*/
extractionDurationMs?: number;
/**
* Total time taken to make the bundle available on disk, in milliseconds. This includes any time
* spent on a streaming attempt that failed and fell back to downloading before extracting.
* Total time taken to make the bundle available on disk, including failed download attempts
* before a fallback, in milliseconds.
*/
totalDurationMs: number;
perLanguage?: PerLanguageToolsStatusReport;
};
export async function downloadAndExtract(
@@ -78,7 +87,7 @@ export async function downloadAndExtract(
logger,
);
const totalDurationMs = Math.round(performance.now() - startTime);
const totalDurationMs = durationMsSince(startTime);
logger.info(
`Finished downloading and extracting CodeQL bundle to ${dest} (${formatDuration(
totalDurationMs,
@@ -88,14 +97,20 @@ export async function downloadAndExtract(
return { totalDurationMs };
}
} catch (e) {
// If we failed during processing, we want to clean up the destination directory
// before we either try again or give up.
await cleanUpPath(dest, "CodeQL bundle", logger);
// Retrying a 404 is pointless: the asset does not exist, so downloading it a different way
// will fail in the same way.
if (asHTTPError(e)?.status === 404) {
throw e;
}
core.warning(
`Failed to download and extract CodeQL bundle using streaming with error: ${getErrorMessage(e)}`,
);
core.warning(`Falling back to downloading the bundle before extracting.`);
// If we failed during processing, we want to clean up the destination directory
// before we try again.
await cleanUpPath(dest, "CodeQL bundle", logger);
}
const toolsDownloadStart = performance.now();
@@ -105,7 +120,7 @@ export async function downloadAndExtract(
authorization,
headers,
);
const downloadDurationMs = Math.round(performance.now() - toolsDownloadStart);
const downloadDurationMs = durationMsSince(toolsDownloadStart);
logger.info(
`Finished downloading CodeQL bundle to ${archivedBundlePath} (${formatDuration(
@@ -125,7 +140,7 @@ export async function downloadAndExtract(
tarVersion,
logger,
);
extractionDurationMs = Math.round(performance.now() - extractionStart);
extractionDurationMs = durationMsSince(extractionStart);
logger.info(
`Finished extracting CodeQL bundle to ${dest} (${formatDuration(
extractionDurationMs,
@@ -138,7 +153,7 @@ export async function downloadAndExtract(
return {
downloadDurationMs,
extractionDurationMs,
totalDurationMs: Math.round(performance.now() - startTime),
totalDurationMs: durationMsSince(startTime),
};
}
@@ -191,9 +206,14 @@ async function downloadAndExtractZstdWithStreaming(
if (response.statusCode !== 200) {
// Discard the response body so that the connection can be released.
response.resume();
throw new Error(
`Failed to download CodeQL bundle from ${codeqlURL}. HTTP status code: ${response.statusCode}.`,
);
const baseMessage = `Failed to download CodeQL bundle from ${codeqlURL}.`;
if (response.statusCode !== undefined) {
throw new HTTPError(
`${baseMessage} HTTP status code: ${response.statusCode}.`,
response.statusCode,
);
}
throw new Error(baseMessage);
}
await tar.extractTarZst(response, dest, tarVersion, logger);

View File

@@ -1,6 +1,7 @@
import * as fs from "fs";
import * as os from "os";
import path from "path";
import { performance } from "perf_hooks";
import * as core from "@actions/core";
import test from "ava";
@@ -508,6 +509,26 @@ test("joinAtMost - truncates list if array is > than limit", (t) => {
t.false(result.includes("test6"));
});
test.serial(
"durationMsSince rounds elapsed milliseconds rather than the timestamps",
(t) => {
const startTime = 1000.25;
const now = sinon.stub(performance, "now");
for (const [endTime, expected] of [
[1000.25, 0],
[1000.74, 0],
[1000.75, 1],
[1001.74, 1],
[1001.75, 2],
[2000.74, 1000],
[2000.75, 1001],
]) {
now.returns(endTime);
t.is(util.durationMsSince(startTime), expected);
}
},
);
test("Success creates a success result", (t) => {
const result = new util.Success("test value");
t.true(result.isSuccess());

View File

@@ -2,6 +2,7 @@ import * as fs from "fs";
import * as fsPromises from "fs/promises";
import * as os from "os";
import * as path from "path";
import { performance } from "perf_hooks";
import * as core from "@actions/core";
import * as io from "@actions/io";
@@ -84,9 +85,32 @@ export async function withTmpDir<T>(
body: (tmpDir: string) => Promise<T>,
): Promise<T> {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "codeql-action-"));
const result = await body(tmpDir);
await fs.promises.rm(tmpDir, { force: true, recursive: true });
return result;
try {
return await body(tmpDir);
} finally {
await fs.promises.rm(tmpDir, { force: true, recursive: true });
}
}
/**
* Creates a temporary file with the given contents, runs the given body, and
* then deletes the file. Note that, to create a temporary file, we first create
* a temporary directory via {@link withTmpDir} and then create the file within
* that directory.
* @param baseFileName The name to assign the temporary file.
* @param contents The contents to write to the temporary file.
* @param body The function to execute with the temporary file.
*/
export async function withTmpFile<T>(
baseFileName: string,
contents: string,
body: (filePath: string) => Promise<T> | T,
): Promise<T> {
return withTmpDir(async (tmpDir) => {
const filePath = path.join(tmpDir, baseFileName);
fs.writeFileSync(filePath, contents);
return body(filePath);
});
}
/**
@@ -658,6 +682,11 @@ export async function bundleDb(
return databaseBundlePath;
}
/** Returns the elapsed milliseconds, rounded, since `startTime` was recorded with `performance.now()`. */
export function durationMsSince(startTime: number): number {
return Math.round(performance.now() - startTime);
}
/**
* @param milliseconds time to delay
* @param opts options

View File

@@ -29,6 +29,6 @@ outputs:
proxy_urls:
description: A stringified JSON array of objects containing the types and URLs of the configured registries.
runs:
using: node24
using: node20
main: "../lib/start-proxy-entry.js"
post: "../lib/start-proxy-post-entry.js"

View File

@@ -37,5 +37,5 @@
"@octokit/core/dist-types/types": ["./node_modules/@octokit/core/dist-types/types.d.ts"]
},
},
"exclude": ["node_modules", "pr-checks", "scripts/changetool"]
"exclude": ["node_modules", "pr-checks"]
}

View File

View File

@@ -41,6 +41,6 @@ outputs:
{ "code-scanning": "some-id", "code-quality": "some-other-id" }
runs:
using: node24
using: node20
main: '../lib/upload-sarif-entry.js'
post: '../lib/upload-sarif-post-entry.js'