Compare commits

...

352 Commits

Author SHA1 Message Date
Kasper Svendsen
4eb247591f Move conversion of PR diff-range paths to absolute paths 2025-11-12 08:10:40 +01:00
Kasper Svendsen
df4e1992c0 Add unit test for diffRangeExtensionPackContents 2025-11-12 08:10:40 +01:00
Kasper Svendsen
d18f3acf74 Move diff-range extension pack generation into testable function 2025-11-12 08:10:39 +01:00
Kasper Svendsen
035c1179af upload-lib: Unit test filterAlertsByDiffRange 2025-11-12 08:10:39 +01:00
Henry Mercer
1d9f357d01 Merge pull request #3281 from github/dependabot/npm_and_yarn/npm-minor-9dd9c1a8e4
Bump the npm-minor group with 4 updates
2025-11-11 10:21:24 +00:00
github-actions[bot]
3d7be7bf78 Rebuild 2025-11-10 17:49:58 +00:00
dependabot[bot]
63bb415fff Bump the npm-minor group with 4 updates
Bumps the npm-minor group with 4 updates: [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [esbuild](https://github.com/evanw/esbuild).


Updates `@eslint/js` from 9.39.0 to 9.39.1
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v9.39.1/packages/js)

Updates `@typescript-eslint/eslint-plugin` from 8.46.3 to 8.46.4
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.4/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.46.3 to 8.46.4
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.4/packages/parser)

Updates `esbuild` from 0.25.12 to 0.27.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.12...v0.27.0)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 9.39.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.46.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.46.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: esbuild
  dependency-version: 0.27.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-10 17:48:25 +00:00
Michael B. Gale
04bd5c6aab Merge pull request #3279 from github/mbg/lint/jsdoc-param-names
Linter: check JSDoc parameter names exist
2025-11-10 11:36:02 +00:00
Michael B. Gale
5b58b8f9c5 Linter: check JSDoc parameter names exist 2025-11-09 10:26:36 +00:00
Henry Mercer
71d0a56d44 Merge pull request #3278 from github/henrymercer/type-fun
Use generic types for durations in status report
2025-11-06 10:47:44 +00:00
Henry Mercer
04285cbe85 Use generic types for durations in status report
This means we don't need to update this interface for every new language.
2025-11-05 18:54:44 +00:00
Mario Campos
320a6b661b Merge pull request #3272 from github/mario-campos/v4-warning
Update deprecation warnings for CodeQL Action to v4
2025-11-05 10:01:33 -06:00
Mario Campos
b5e5a258e6 Merge branch 'main' into mario-campos/v4-warning 2025-11-05 09:39:54 -06:00
Mario Campos
74f662193b Reformat with eslint 2025-11-05 09:37:42 -06:00
Mario Campos
ecee3ea8f5 Update CHANGELOG.md. 2025-11-05 09:18:30 -06:00
Mario Campos
6a63bc6af3 Change warning message to just v3 (exclude v1, v2). 2025-11-05 09:15:53 -06:00
Henry Mercer
e2ef519c75 Merge pull request #3224 from github/henrymercer/clean-up-resolve-languages-ff
Clean up `resolve_supported_languages_using_cli` FF
2025-11-05 11:57:35 +00:00
Michael B. Gale
423d14e583 Merge pull request #3277 from github/mbg/ci/update-bundle-python
Install Python in `update-bundle` workflow
2025-11-05 11:53:17 +00:00
Michael B. Gale
6dd11f73d3 Update .github/workflows/script/bundle_changelog.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-05 11:34:26 +00:00
Michael B. Gale
c9f82f2adf Move python script to file 2025-11-05 11:22:38 +00:00
Michael B. Gale
33684ef869 Add setup-python step to update-bundle workflow 2025-11-05 11:20:06 +00:00
Michael B. Gale
5aa2d63d5b Merge branch 'main' into mario-campos/v4-warning 2025-11-05 11:03:25 +00:00
Michael B. Gale
862f5666b3 Merge pull request #3275 from github/mbg/checks/filter-ccr
Filter CCR jobs in `update-required-checks.sh`
2025-11-05 10:15:57 +00:00
Michael B. Gale
b00addd1d3 Merge pull request #3274 from github/mbg/macos-13 2025-11-05 09:01:53 +00:00
Michael B. Gale
d03fd76232 Filter CCR jobs in update-required-checks.sh 2025-11-04 22:23:12 +00:00
Michael B. Gale
9d5565fba2 Remove macos-13 from codeql workflow 2025-11-04 21:29:25 +00:00
Mario Campos
a570795dfc Clarify the CHANGELOG.md entry to reflect the whole action, and not just init. 2025-11-04 12:02:15 -06:00
Mario Campos
9366f80399 Reference GHES 3.20 in the comment, not 3.19.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-04 12:00:11 -06:00
Mario Campos
c443dff433 Simplify warning language to not enumerate deprecated versions. 2025-11-04 11:57:44 -06:00
Mario Campos
b32a1e0627 Update test cases for GitHub Enterprise Server versions 3.11 and 3.12 to reflect correct deprecation status 2025-11-04 11:51:23 -06:00
Mario Campos
08dc635f27 Restore use of sinon.match(). 2025-11-04 11:11:08 -06:00
Mario Campos
f1ca6a4f47 Update tests to reflect deprecation status of CodeQL Action v3 2025-11-04 11:07:15 -06:00
Mario Campos
ba82f9bd34 Fix deprecation warning to reflect that v3 is not actually deprecated yet. 2025-11-04 10:13:07 -06:00
Mario Campos
5a9b49de7e Update CHANGELOG to reflect warning for v3 users migrating to v4 of CodeQL Action 2025-11-04 10:09:47 -06:00
Mario Campos
1aade295bc Update deprecation warnings for CodeQL Action to v4 2025-11-04 09:59:16 -06:00
Henry Mercer
95b1867cf7 Merge pull request #3269 from github/dependabot/npm_and_yarn/actions/io-2.0.0
Bump @actions/io from 1.1.3 to 2.0.0
2025-11-04 14:23:27 +00:00
github-actions[bot]
238f5f2946 Rebuild 2025-11-04 14:00:06 +00:00
dependabot[bot]
a53b4967d7 Bump @actions/io from 1.1.3 to 2.0.0
Bumps [@actions/io](https://github.com/actions/toolkit/tree/HEAD/packages/io) from 1.1.3 to 2.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/io/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/io)

---
updated-dependencies:
- dependency-name: "@actions/io"
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 13:58:17 +00:00
Henry Mercer
493ffd8e5c Merge pull request #3268 from github/dependabot/npm_and_yarn/types/archiver-7.0.0
Bump @types/archiver from 6.0.4 to 7.0.0
2025-11-04 13:56:51 +00:00
github-actions[bot]
f23547cd26 Rebuild 2025-11-04 12:25:05 +00:00
dependabot[bot]
58f5e3dab8 Bump @types/archiver from 6.0.4 to 7.0.0
Bumps [@types/archiver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/archiver) from 6.0.4 to 7.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/archiver)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-04 12:19:24 +00:00
Henry Mercer
98e0ffef96 Merge pull request #3266 from github/dependabot/npm_and_yarn/npm-minor-29e8df1594
Bump the npm-minor group with 7 updates
2025-11-04 11:09:56 +00:00
github-actions[bot]
85eb524170 Rebuild 2025-11-04 10:34:56 +00:00
dependabot[bot]
a3ea4ef532 Bump the npm-minor group with 7 updates
Bumps the npm-minor group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [@octokit/request-error](https://github.com/octokit/request-error.js) | `7.0.1` | `7.0.2` |
| [octokit](https://github.com/octokit/octokit.js) | `5.0.4` | `5.0.5` |
| [@eslint/compat](https://github.com/eslint/rewrite/tree/HEAD/packages/compat) | `1.4.0` | `1.4.1` |
| [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) | `9.38.0` | `9.39.0` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.46.2` | `8.46.3` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.46.2` | `8.46.3` |
| [esbuild](https://github.com/evanw/esbuild) | `0.25.11` | `0.25.12` |


Updates `@octokit/request-error` from 7.0.1 to 7.0.2
- [Release notes](https://github.com/octokit/request-error.js/releases)
- [Commits](https://github.com/octokit/request-error.js/compare/v7.0.1...v7.0.2)

Updates `octokit` from 5.0.4 to 5.0.5
- [Release notes](https://github.com/octokit/octokit.js/releases)
- [Commits](https://github.com/octokit/octokit.js/compare/v5.0.4...v5.0.5)

Updates `@eslint/compat` from 1.4.0 to 1.4.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-v1.4.1/packages/compat)

Updates `@eslint/js` from 9.38.0 to 9.39.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v9.39.0/packages/js)

Updates `@typescript-eslint/eslint-plugin` from 8.46.2 to 8.46.3
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.3/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.46.2 to 8.46.3
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.3/packages/parser)

Updates `esbuild` from 0.25.11 to 0.25.12
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.11...v0.25.12)

---
updated-dependencies:
- dependency-name: "@octokit/request-error"
  dependency-version: 7.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: octokit
  dependency-version: 5.0.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@eslint/compat"
  dependency-version: 1.4.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@eslint/js"
  dependency-version: 9.39.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.46.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.46.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: esbuild
  dependency-version: 0.25.12
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 18:47:33 +00:00
Henry Mercer
97580d7533 Merge pull request #3267 from github/dependabot/npm_and_yarn/octokit/types-16.0.0
Bump @octokit/types from 15.0.1 to 16.0.0
2025-11-03 18:12:51 +00:00
Henry Mercer
7ad64f0258 Merge pull request #3270 from github/dependabot/npm_and_yarn/actions/http-client-3.0.0
Bump @actions/http-client from 2.2.3 to 3.0.0
2025-11-03 18:11:30 +00:00
github-actions[bot]
61bcb70dce Rebuild 2025-11-03 17:22:15 +00:00
github-actions[bot]
5313cd14a8 Rebuild 2025-11-03 17:21:50 +00:00
dependabot[bot]
8fa298d060 Bump @actions/http-client from 2.2.3 to 3.0.0
Bumps [@actions/http-client](https://github.com/actions/toolkit/tree/HEAD/packages/http-client) from 2.2.3 to 3.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/http-client/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/http-client)

---
updated-dependencies:
- dependency-name: "@actions/http-client"
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 17:20:38 +00:00
dependabot[bot]
7d1bed2dd0 Bump @octokit/types from 15.0.1 to 16.0.0
Bumps [@octokit/types](https://github.com/octokit/types.ts) from 15.0.1 to 16.0.0.
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v15.0.1...v16.0.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 17:20:12 +00:00
Michael B. Gale
338146ca93 Merge pull request #3264 from github/mbg/ci/publish-on-tag
Create immutable action version on tag push
2025-10-31 16:48:43 +00:00
Michael B. Gale
64db1da706 Create immutable action version on tag push 2025-10-31 16:24:23 +00:00
Henry Mercer
9bd8638576 Merge pull request #3262 from github/mergeback/v4.31.2-to-main-0499de31
Mergeback v4.31.2 refs/heads/releases/v4 into main
2025-10-30 15:07:33 +00:00
github-actions[bot]
65da12b256 Rebuild 2025-10-30 14:36:57 +00:00
github-actions[bot]
c228fecc25 Update changelog and version after v4.31.2 2025-10-30 14:33:10 +00:00
Henry Mercer
0499de31b9 Merge pull request #3261 from github/henrymercer/setup-python
Set up Python in mergeback workflow
2025-10-30 14:30:19 +00:00
Henry Mercer
3b96745d2b Set up Python in mergeback workflow 2025-10-30 14:06:12 +00:00
Michael B. Gale
8a06050a8c Merge pull request #3259 from github/update-v4.31.2-9576b5cbe
Merge main into releases/v4
2025-10-30 13:47:48 +00:00
github-actions[bot]
752a642cb2 Update changelog for v4.31.2 2025-10-30 13:27:33 +00:00
Michael B. Gale
9576b5cbe8 Merge pull request #3258 from github/mbg/enablement-errors/case-insensitive
Make `isEnablementError` case-insensitive
2025-10-30 11:59:43 +00:00
Henry Mercer
cc8843728c Merge pull request #3257 from github/henrymercer/ubuntu-slim
Run lightweight workflows on `ubuntu-slim`
2025-10-30 11:44:22 +00:00
Michael B. Gale
f0e9bf07f4 Make isEnablementError case-insensitive 2025-10-30 11:37:07 +00:00
Henry Mercer
2a3599c520 Run lightweight workflows on ubuntu-slim 2025-10-30 11:25:32 +00:00
Henry Mercer
514ff4d116 Merge pull request #3256 from github/henrymercer/resolve-bad-merge
Remove unused `console-log-level` dependency
2025-10-30 11:19:24 +00:00
Henry Mercer
aab1c2f931 Merge pull request #3253 from github/mergeback/v4.31.1-to-main-5fe9434c
Mergeback v4.31.1 refs/heads/releases/v4 into main
2025-10-30 11:04:54 +00:00
Henry Mercer
b2bffa615d Remove unused console-log-level dependency
This was added back by a bad merge.
2025-10-30 10:40:23 +00:00
github-actions[bot]
e7811794d3 Rebuild 2025-10-30 10:31:33 +00:00
github-actions[bot]
c7a5b09374 Merge remote-tracking branch 'origin/main' into mergeback/v4.31.1-to-main-5fe9434c 2025-10-30 10:30:29 +00:00
github-actions[bot]
cbcb06a3ae Update changelog and version after v4.31.1 2025-10-30 10:29:22 +00:00
Henry Mercer
5fe9434cd2 Merge pull request #3252 from github/update-v4.31.1-777daa0c7
Merge main into releases/v4
2025-10-30 10:28:34 +00:00
Henry Mercer
8d50be301c Merge pull request #3245 from github/dependabot/github_actions/dot-github/workflows/actions/download-artifact-6
Bump actions/download-artifact from 5 to 6 in /.github/workflows
2025-10-30 10:02:36 +00:00
github-actions[bot]
237497c8f0 Update changelog for v4.31.1 2025-10-30 09:40:55 +00:00
Michael B. Gale
777daa0c71 Merge pull request #3239 from github/mbg/remove/add-snippets
Remove `add-snippets` input
2025-10-29 13:32:20 +00:00
Michael B. Gale
74c8748a6f Update analyze/action.yml
Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
2025-10-29 10:34:13 +00:00
Michael B. Gale
34c50c1d29 Merge pull request #3251 from github/mbg/user-error/enablement
Turn enablement errors into configuration errors
2025-10-29 09:57:38 +00:00
Michael B. Gale
4ae68afd84 Warn if the add-snippets input is used 2025-10-29 09:29:28 +00:00
Michael B. Gale
52a7bd7b6e Check for 403 status 2025-10-29 08:35:19 +00:00
Michael B. Gale
194ba0ee2d Make error message tests less brittle 2025-10-29 08:29:11 +00:00
Michael B. Gale
53acf0b8aa Turn enablement errors into configuration errors 2025-10-28 21:17:30 +00:00
Henry Mercer
ac9aeee226 Merge pull request #3249 from github/henrymercer/api-logging
Use Actions logger in API client
2025-10-28 17:05:58 +00:00
Henry Mercer
d49e837b8c Merge branch 'main' into henrymercer/api-logging 2025-10-28 16:49:10 +00:00
Henry Mercer
3d988b275a Pass minimal copy of core 2025-10-28 16:33:21 +00:00
Henry Mercer
8cc18acfa4 Merge pull request #3250 from github/henrymercer/prefer-fs-delete
Use Node `fs` APIs instead of `del`
2025-10-28 15:45:56 +00:00
Henry Mercer
ea5cb4a016 Merge branch 'main' into henrymercer/prefer-fs-delete 2025-10-28 15:26:42 +00:00
Henry Mercer
e1c8976a56 Merge pull request #3247 from github/henrymercer/disk-usage-node-api
Check disk usage using Node.js API
2025-10-28 15:24:12 +00:00
Henry Mercer
4256e2e2a0 Merge branch 'main' into henrymercer/disk-usage-node-api 2025-10-28 15:05:13 +00:00
Henry Mercer
66459ea37c Apply suggestion 2025-10-28 15:04:31 +00:00
Henry Mercer
1af9394995 Merge pull request #3244 from github/dependabot/github_actions/dot-github/workflows/actions-minor-b11285d543
Bump ruby/setup-ruby from 1.265.0 to 1.267.0 in /.github/workflows in the actions-minor group across 1 directory
2025-10-28 13:28:36 +00:00
Henry Mercer
311fc42780 Merge pull request #3242 from github/dependabot/npm_and_yarn/npm-minor-75b724c14c
Bump the npm-minor group with 4 updates
2025-10-28 13:25:25 +00:00
Henry Mercer
284bf9b047 Merge pull request #3241 from github/dependabot/github_actions/dot-github/workflows/actions/upload-artifact-5
Bump actions/upload-artifact from 4 to 5 in /.github/workflows
2025-10-28 13:23:08 +00:00
Henry Mercer
a53e78ee2a Merge pull request #3243 from github/dependabot/npm_and_yarn/actions/artifact-4.0.0
Bump @actions/artifact from 2.3.1 to 4.0.0
2025-10-28 13:12:23 +00:00
Henry Mercer
d84f470a9a Improve method naming 2025-10-28 13:06:14 +00:00
Henry Mercer
41c0a26213 Use Node fs APIs instead of del 2025-10-28 13:00:25 +00:00
Henry Mercer
d4ba404a20 Tweak assertions 2025-10-28 12:50:22 +00:00
Henry Mercer
55895ef678 Stub GITHUB_WORKSPACE in test 2025-10-28 12:45:22 +00:00
Henry Mercer
fe16891f40 Add unit test for checkDiskUsage 2025-10-28 12:40:23 +00:00
Henry Mercer
57c7b6afb6 Disable SIP disablement check 2025-10-28 12:35:41 +00:00
Michael B. Gale
44aeac1a37 Merge branch 'main' into dependabot/github_actions/dot-github/workflows/actions/download-artifact-6 2025-10-28 12:21:17 +00:00
Henry Mercer
8b1e55d11e Use Actions logger in API client
This allows us to remove the `console-log-level` dependency.
2025-10-28 12:15:03 +00:00
Henry Mercer
20900ee769 Build: Run npm install when package-lock.json out of date 2025-10-28 11:52:42 +00:00
Michael B. Gale
ad8ad9829e Merge pull request #3240 from github/mbg/allow-skip-workflow-validation
Support skipping workflow validation
2025-10-28 11:46:08 +00:00
Henry Mercer
239e305d18 Check disk usage using Node.js API
This was introduced in Node.js 18
2025-10-27 18:34:23 +00:00
dependabot[bot]
9c39f0afb0 Bump actions/download-artifact from 5 to 6 in /.github/workflows
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 18:05:01 +00:00
github-actions[bot]
fcc1377ac6 Rebuild 2025-10-27 17:54:41 +00:00
dependabot[bot]
b5bbb5ab73 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.265.0 to 1.267.0
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](ab177d40ee...d5126b9b35)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 17:52:58 +00:00
github-actions[bot]
723a9469fd Rebuild 2025-10-27 17:41:35 +00:00
dependabot[bot]
f9eed03ba2 Bump @actions/artifact from 2.3.1 to 4.0.0
Bumps [@actions/artifact](https://github.com/actions/toolkit/tree/HEAD/packages/artifact) from 2.3.1 to 4.0.0.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/artifact/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/cache@4.0.0/packages/artifact)

---
updated-dependencies:
- dependency-name: "@actions/artifact"
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 17:39:59 +00:00
github-actions[bot]
df9e49e9e8 Rebuild 2025-10-27 17:37:24 +00:00
dependabot[bot]
c9d47e2ee9 Bump the npm-minor group with 4 updates
Bumps the npm-minor group with 4 updates: [@octokit/types](https://github.com/octokit/types.ts), [@types/archiver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/archiver), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `@octokit/types` from 15.0.0 to 15.0.1
- [Release notes](https://github.com/octokit/types.ts/releases)
- [Commits](https://github.com/octokit/types.ts/compare/v15.0.0...v15.0.1)

Updates `@types/archiver` from 6.0.3 to 6.0.4
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/archiver)

Updates `@typescript-eslint/eslint-plugin` from 8.46.1 to 8.46.2
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.2/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.46.1 to 8.46.2
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.2/packages/parser)

---
updated-dependencies:
- dependency-name: "@octokit/types"
  dependency-version: 15.0.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@types/archiver"
  dependency-version: 6.0.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.46.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.46.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 17:35:52 +00:00
github-actions[bot]
714962e17a Rebuild 2025-10-27 17:30:37 +00:00
dependabot[bot]
42f957bb51 Bump actions/upload-artifact from 4 to 5 in /.github/workflows
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-27 17:28:57 +00:00
Michael B. Gale
52cec4178d Downgrade log message from warning to debug level 2025-10-27 17:02:01 +00:00
Michael B. Gale
55c083790a Move checkWorkflow to workflow.ts 2025-10-27 17:01:23 +00:00
Michael B. Gale
50601762ea Also skip workflow validation for dynamic workflows 2025-10-27 16:10:08 +00:00
Michael B. Gale
06fbd897c4 Move workflow check to a function in init.ts and add tests 2025-10-27 15:57:44 +00:00
Michael B. Gale
127851b399 Add environment variable for skipping workflow validation 2025-10-27 15:42:43 +00:00
Kasper Svendsen
8d77149e0c Merge pull request #3238 from github/kaspersv/extract-diff-range-computation
Move diff-range computation into utils
2025-10-27 15:40:12 +01:00
Michael B. Gale
db47d17142 Remove add-snippets input 2025-10-27 12:53:23 +00:00
Kasper Svendsen
cc17bed958 Move diff-range computation tests 2025-10-27 09:46:16 +01:00
Kasper Svendsen
91ec0ed58f Move diff-range computation into utils for reuse 2025-10-27 09:43:11 +01:00
Kasper Svendsen
4e0b2cd814 Merge pull request #3232 from github/kaspersv/unique-overlay-base-keys
Ensure uniqueness of overlay-base database cache keys
2025-10-27 08:36:12 +01:00
Michael B. Gale
ae78991f55 Merge pull request #3236 from github/mergeback/v4.31.0-to-main-4e94bd11
Mergeback v4.31.0 refs/heads/releases/v4 into main
2025-10-24 18:30:37 +01:00
github-actions[bot]
dd565f3332 Rebuild 2025-10-24 17:11:09 +00:00
github-actions[bot]
fa46f22b12 Update changelog and version after v4.31.0 2025-10-24 17:08:58 +00:00
Michael B. Gale
4e94bd11f7 Merge pull request #3235 from github/update-v4.31.0-1d36546c1
Merge main into releases/v4
2025-10-24 18:08:08 +01:00
github-actions[bot]
8f11182164 Update changelog for v4.31.0 2025-10-24 16:33:59 +00:00
Michael B. Gale
1d36546c14 Merge pull request #3234 from github/mbg/changelog/post-processing
Add changelog entry for post-processing change
2025-10-24 17:26:22 +01:00
Michael B. Gale
08ada26e6a Add changelog entry for post-processing change 2025-10-24 17:07:13 +01:00
Michael B. Gale
b843cbeed0 Merge pull request #3233 from github/mbg/getOptionalEnvVar
Add `getOptionalEnvVar` helper
2025-10-24 16:55:48 +01:00
Michael B. Gale
1ecd563919 Use getOptionalEnvVar in writePostProcessedFiles 2025-10-24 16:18:09 +01:00
Henry Mercer
e576807920 Merge pull request #3223 from github/henrymercer/bump-minimum
Bump minimum CodeQL Bundle version to 2.17.6
2025-10-24 15:11:27 +01:00
Michael B. Gale
ad35676669 Add getOptionalEnvVar function
Also add tests for it and `getRequiredEnvParam`
2025-10-24 15:00:42 +01:00
Michael B. Gale
d75645b13f Merge pull request #3222 from github/mbg/upload-lib/post-process
Perform SARIF post-processing independently of upload
2025-10-24 14:59:04 +01:00
Kasper Svendsen
66759e57b2 Improve error handling for overlay-base cache key creation 2025-10-24 15:49:26 +02:00
Kasper Svendsen
cbcae45fff Reorder components of overlay-base cache key postfix 2025-10-24 15:46:17 +02:00
Michael B. Gale
710606cc35 Check that outputPath is non-empty 2025-10-24 14:42:36 +01:00
Michael B. Gale
f0452d5366 Consistently use "post-processing" 2025-10-24 10:20:25 +01:00
Kasper Svendsen
956c56734d Merge pull request #3231 from github/kaspersv/lower-overlay-base-size-limit
Overlay: Lower size limit for overlay base databases
2025-10-24 11:12:25 +02:00
Kasper Svendsen
b4ce335286 Ensure uniqueness of overlay-base database cache keys 2025-10-24 11:11:57 +02:00
Michael B. Gale
b9cd36824e Merge remote-tracking branch 'origin/main' into mbg/upload-lib/post-process 2025-10-24 10:08:38 +01:00
Chuan-kai Lin
c4b73722ba Add overlay-base database cache key tests 2025-10-24 10:47:17 +02:00
Kasper Svendsen
22d29ca74d Overlay: Lower size limit for overlay base databases 2025-10-24 08:06:42 +02:00
Michael B. Gale
9625890712 Merge pull request #3227 from github/mbg/permission-warning
Update wording in some log messages
2025-10-23 16:30:13 +01:00
Michael B. Gale
690d276755 Merge branch 'main' into mbg/permission-warning 2025-10-23 15:50:48 +01:00
Michael B. Gale
1c3c8066c3 Merge pull request #3228 from github/mbg/test/timeout
Bump timeout for `analyze-action-env` test
2025-10-23 15:49:27 +01:00
Michael B. Gale
da64a41e37 Bump timeout for analyze-action-input test 2025-10-23 15:23:21 +01:00
Michael B. Gale
8376af204a Bump timeout for analyze-action-env test 2025-10-23 13:39:38 +01:00
Michael B. Gale
f48b54af10 Fix fallback not being guarded by uploadKind check 2025-10-23 13:34:03 +01:00
Michael B. Gale
40b4cdd21f Update status report messages 2025-10-23 13:12:19 +01:00
Michael B. Gale
e849c567ec Update debug message 2025-10-23 13:04:06 +01:00
Michael B. Gale
d1b51f05c9 Update API permissions warning 2025-10-23 13:02:31 +01:00
Michael B. Gale
aed27f7231 Fix linter issue 2025-10-22 19:25:34 +01:00
Michael B. Gale
8ff870a6c2 Rename new input to processed-sarif-path 2025-10-22 19:12:57 +01:00
Michael B. Gale
6f0fcbeea7 Rename uploadSarif 2025-10-22 19:09:39 +01:00
Michael B. Gale
89d3359017 Improve test name 2025-10-22 19:05:05 +01:00
Michael B. Gale
d79c0a1339 Fix incomplete comment 2025-10-22 19:03:23 +01:00
Michael B. Gale
5e37670026 Use post-process-output in PR check 2025-10-22 19:01:42 +01:00
Michael B. Gale
def04c1c0e Add test for uploadSarif with output directory 2025-10-22 19:01:42 +01:00
Michael B. Gale
12f3cfef09 Write processed SARIF files if post-process-output input is provided 2025-10-22 19:01:40 +01:00
Michael B. Gale
c2bec36917 Add post-process-output input to analyze action 2025-10-22 19:00:33 +01:00
Michael B. Gale
14139c9f77 Add test for uploadSarif with upload: never 2025-10-22 19:00:33 +01:00
Michael B. Gale
596de7f1bc Move UploadKind check into uploadSarif 2025-10-22 19:00:29 +01:00
Michael B. Gale
899bf2fd1e Use postProcessSarifFiles and uploadProcessedFiles in uploadSarif 2025-10-22 18:48:24 +01:00
Michael B. Gale
6fbdd5f4e9 Split SARIF uploading steps from uploadSpecifiedFiles into a function 2025-10-22 18:48:03 +01:00
Michael B. Gale
489ed914f1 Split SARIF post-processing steps from uploadSpecifiedFiles into a function 2025-10-22 18:48:00 +01:00
Michael B. Gale
42642085de Merge pull request #3206 from github/mbg/analyze/use-upload-sarif
Use `uploadSarif` rather than `uploadFiles` in `analyze` action
2025-10-22 17:45:25 +01:00
Henry Mercer
4bd7dfe989 Merge pull request #3226 from github/henrymercer/prefer-optional-chaining
Linting: Prefer optional chaining
2025-10-22 17:13:00 +01:00
Michael B. Gale
ebd514f490 Address review comments 2025-10-22 17:11:19 +01:00
Henry Mercer
a691497d40 Clean up resolve_supported_languages_using_cli FF 2025-10-22 17:04:42 +01:00
Henry Mercer
e5f165b8f5 Linting: Prefer optional chaining 2025-10-22 16:55:06 +01:00
Michael B. Gale
c98d5a9a4f Use checkoutPath and category constants consistently 2025-10-22 16:12:07 +01:00
Michael B. Gale
b7c814cb39 Gate uploadSarif behind FF, use old implementation otherwise 2025-10-22 15:54:51 +01:00
Michael B. Gale
f88cb01694 Add AnalyzeUseNewUpload feature 2025-10-22 15:49:28 +01:00
Henry Mercer
3cd3374657 Bump minor version number 2025-10-22 12:27:15 +01:00
Henry Mercer
3934593862 Remove analysisSummaryV2Default FF 2025-10-22 12:25:25 +01:00
Henry Mercer
bab3f2b5f5 Remove sarifMergeRunsFromEqualCategory FF 2025-10-22 12:22:55 +01:00
Henry Mercer
9924f476ba Add changelog note 2025-10-22 12:20:17 +01:00
Henry Mercer
bd5f49c7ca Bump minimum version to 2.17.6 2025-10-22 12:19:35 +01:00
Michael B. Gale
02b2c3aafc Fix style inconsistency 2025-10-22 12:04:04 +01:00
Michael B. Gale
aa048acb05 Merge branch 'main' into mbg/analyze/use-upload-sarif 2025-10-22 00:42:55 +01:00
Michael B. Gale
0c5185d061 Merge pull request #3221 from github/mbg/code-quality/skip-db-upload
Always skip database upload if `AnalysisKind.CodeScanning` is not enabled
2025-10-21 13:10:37 +01:00
Michael B. Gale
79ed9569a3 Always skip database upload if AnalysisKind.CodeScanning is not enabled 2025-10-21 12:33:56 +01:00
Henry Mercer
8e53c48f94 Merge pull request #3217 from github/henrymercer/http-error-handling
Wrap API configuration errors when setting up CodeQL
2025-10-21 12:15:21 +01:00
Henry Mercer
804fc665f9 Merge branch 'main' into henrymercer/http-error-handling 2025-10-21 10:37:41 +01:00
Henry Mercer
e6e649a8f3 Simplify API error checks 2025-10-21 10:31:53 +01:00
Henry Mercer
40e26468f3 Require message field too 2025-10-21 10:27:54 +01:00
Michael B. Gale
9b0ac1cc3b Merge pull request #3203 from github/mbg/errors/more-user-errors
Handle user errors for invalid `UserConfig`s and missing query files
2025-10-20 19:32:51 +01:00
Michael B. Gale
ffed63adb8 Merge pull request #3219 from github/dependabot/npm_and_yarn/npm-minor-5ed6ededba
Bump the npm-minor group with 5 updates
2025-10-20 19:14:12 +01:00
Michael B. Gale
bee06ec042 Merge pull request #3220 from github/dependabot/github_actions/dot-github/workflows/actions/setup-node-6
Bump actions/setup-node from 5 to 6 in /.github/workflows
2025-10-20 19:09:32 +01:00
github-actions[bot]
06f31ec789 Rebuild 2025-10-20 17:27:37 +00:00
dependabot[bot]
53588c5ad2 Bump actions/setup-node from 5 to 6 in /.github/workflows
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 17:26:07 +00:00
github-actions[bot]
2357c43cad Rebuild 2025-10-20 17:18:26 +00:00
dependabot[bot]
a3ff966dbf Bump the npm-minor group with 5 updates
Bumps the npm-minor group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [octokit](https://github.com/octokit/octokit.js) | `5.0.3` | `5.0.4` |
| [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) | `9.37.0` | `9.38.0` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.46.0` | `8.46.1` |
| [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.46.0` | `8.46.1` |
| [esbuild](https://github.com/evanw/esbuild) | `0.25.10` | `0.25.11` |


Updates `octokit` from 5.0.3 to 5.0.4
- [Release notes](https://github.com/octokit/octokit.js/releases)
- [Commits](https://github.com/octokit/octokit.js/compare/v5.0.3...v5.0.4)

Updates `@eslint/js` from 9.37.0 to 9.38.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v9.38.0/packages/js)

Updates `@typescript-eslint/eslint-plugin` from 8.46.0 to 8.46.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.1/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.46.0 to 8.46.1
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.1/packages/parser)

Updates `esbuild` from 0.25.10 to 0.25.11
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.10...v0.25.11)

---
updated-dependencies:
- dependency-name: octokit
  dependency-version: 5.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@eslint/js"
  dependency-version: 9.38.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.46.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.46.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: esbuild
  dependency-version: 0.25.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 17:17:00 +00:00
Henry Mercer
6562050a4e Merge pull request #3218 from github/henrymercer/pr-sizes
Add experimental functionality for labelling PRs by their size
2025-10-20 17:45:46 +01:00
Henry Mercer
e9daf5bcd9 Comment version that is pinned
Co-authored-by: Michael B. Gale <mbg@github.com>
2025-10-20 17:25:01 +01:00
Henry Mercer
c13672ee32 Bump sizes a bit 2025-10-20 16:48:51 +01:00
Henry Mercer
f2f52d0d47 Add score for XL 2025-10-20 15:13:53 +01:00
Henry Mercer
08e53bec85 Update .github/sizeup.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-20 15:12:50 +01:00
Henry Mercer
519594fe94 Update workflow name 2025-10-20 15:12:25 +01:00
Henry Mercer
8c324fe288 Add experimental functionality for labelling PRs by their size 2025-10-20 15:10:40 +01:00
Henry Mercer
a6b9514fab Wrap API configuration errors when setting up CodeQL 2025-10-20 15:01:44 +01:00
Henry Mercer
c64c4070cc Handle HTTP errors with httpStatusCode property 2025-10-20 14:38:02 +01:00
Henry Mercer
d88a5540c3 Merge pull request #3215 from github/mergeback/v4.30.9-to-main-16140ae1
Mergeback v4.30.9 refs/heads/releases/v4 into main
2025-10-17 17:06:54 +01:00
github-actions[bot]
aa0f6ea898 Rebuild 2025-10-17 15:40:22 +00:00
github-actions[bot]
b03dcd5d9d Update changelog and version after v4.30.9 2025-10-17 15:23:37 +00:00
Henry Mercer
16140ae1a1 Merge pull request #3213 from github/update-v4.30.9-70205d3d1
Merge main into releases/v4
2025-10-17 16:22:48 +01:00
github-actions[bot]
30db5fee08 Update changelog for v4.30.9 2025-10-17 14:54:08 +00:00
Michael B. Gale
9ce56a247f Make schema for QueryFilter less strict 2025-10-17 15:11:16 +01:00
Michael B. Gale
2c8f4891d1 Add FF for config validation 2025-10-17 15:11:13 +01:00
Michael B. Gale
d7a8ae5fdd Include first 10 errors in exception message 2025-10-17 15:09:05 +01:00
Michael B. Gale
0822fb12e7 Log validation errors 2025-10-17 15:09:04 +01:00
Michael B. Gale
913cd47984 Add checkExpectedLogMessages function to testing-utils 2025-10-17 15:09:04 +01:00
Michael B. Gale
4f14649ced Add additional regex to CliConfigErrorCategory.PackCannotBeFound 2025-10-17 15:09:03 +01:00
Michael B. Gale
ac922ab562 Add and validate UserConfig schema 2025-10-17 15:09:01 +01:00
Michael B. Gale
66df0bc515 Add and use parseUserConfig
- Throws a `ConfigurationError` if parsing the YAML fails
- Add a couple of tests for it
2025-10-17 15:08:59 +01:00
Michael B. Gale
70205d3d12 Merge pull request #3211 from github/mbg/init/starting-partial-config
Make analysis kinds available for `starting` status report
2025-10-17 14:46:51 +01:00
Michael B. Gale
697c209bfc Merge remote-tracking branch 'origin/main' into mbg/init/starting-partial-config 2025-10-17 14:21:44 +01:00
Henry Mercer
1bd53ba38c Merge pull request #3205 from github/update-bundle/codeql-bundle-v2.23.3
Update default bundle to 2.23.3
2025-10-17 14:18:19 +01:00
github-actions[bot]
cac4df0c79 Rebuild 2025-10-17 12:59:18 +00:00
Henry Mercer
77e5c0d0a2 Merge branch 'main' into update-bundle/codeql-bundle-v2.23.3 2025-10-17 13:53:02 +01:00
Michael B. Gale
97a4f751be Merge pull request #3204 from github/mbg/setup-codeql
Add `setup-codeql` action
2025-10-17 13:47:42 +01:00
Michael B. Gale
2d5512b361 Merge remote-tracking branch 'origin/main' into mbg/init/starting-partial-config 2025-10-17 13:44:28 +01:00
Michael B. Gale
fa7bdf0559 Call getAnalysisKinds a second time, and ignore exceptions thrown during the first call 2025-10-17 13:40:18 +01:00
Michael B. Gale
57c7b0a884 Rename initAnalysisKinds to getAnalysisKinds and cache results 2025-10-17 13:33:55 +01:00
Michael B. Gale
4874f90a8d Merge branch 'main' into mbg/setup-codeql 2025-10-17 13:32:40 +01:00
Michael B. Gale
5a9e92afca Merge pull request #3212 from github/mbg/ci/pin-python
Install Python 3.13 to fix failing PR checks with older CLI versions
2025-10-17 13:31:26 +01:00
Michael B. Gale
9bd9b03572 Remove now unused qualityQueriesInput from InitConfigInputs 2025-10-17 13:22:41 +01:00
Michael B. Gale
3569065d7e Install Python 3.13, except for nightly-latest 2025-10-17 12:51:50 +01:00
Michael B. Gale
c0e8887d5a Throw a ConfigurationError if setup-codeql has run before init 2025-10-17 12:17:47 +01:00
Michael B. Gale
3c8d00aea0 Initialise analysis kinds before starting status report 2025-10-17 11:46:35 +01:00
Michael B. Gale
bc93b04b0c Add initAnalysisKinds for analysis-kinds enablement logic 2025-10-17 11:43:00 +01:00
Michael B. Gale
adf39dd33f Add function for starting status report 2025-10-17 11:16:00 +01:00
Michael B. Gale
000295122d Use failure instead of aborted 2025-10-16 19:05:03 +01:00
Michael B. Gale
2611d033d7 De-duplicate InitToolsDownloadFIelds definition 2025-10-16 19:03:46 +01:00
Michael B. Gale
ee753b4724 Merge pull request #3209 from github/mbg/code-quality/skip-failed-upload
Skip failed SARIF upload if Code Quality is the only analysis kind
2025-10-16 15:22:01 +01:00
Michael B. Gale
db6938a4d0 Change check to be restrictive by default 2025-10-16 15:06:19 +01:00
Michael B. Gale
d02f50ee62 Update changelog for setup-codeql 2025-10-16 14:50:16 +01:00
Michael B. Gale
f4237b7e76 Add setup-codeql to README 2025-10-16 14:48:35 +01:00
Michael B. Gale
302fc5e00d Update docs 2025-10-16 14:46:35 +01:00
Michael B. Gale
c77b3fb96e Skip failed SARIF upload if analysis-kinds: code-quality 2025-10-16 14:27:17 +01:00
Michael B. Gale
2a54ab5016 Fix init-action-post-helper tests using broken Configs 2025-10-16 14:18:51 +01:00
Michael B. Gale
2ade8a09a3 Use uploadSarif rather than uploadFiles in analyze action 2025-10-14 19:49:42 +01:00
github-actions[bot]
a60e5ce8ec Add changelog note 2025-10-14 12:53:29 +00:00
github-actions[bot]
8d0251c1f7 Update default bundle to codeql-bundle-v2.23.3 2025-10-14 12:53:17 +00:00
Michael B. Gale
80220dcd46 Use setup-codeql action in bundle-from-toolcache check 2025-10-12 14:14:07 +01:00
Michael B. Gale
e72fd9acb1 Add initial setup-codeql action 2025-10-12 14:14:06 +01:00
Michael B. Gale
17783bfb99 Merge pull request #3199 from github/mergeback/v4.30.8-to-main-f443b600
Mergeback v4.30.8 refs/heads/releases/v4 into main
2025-10-10 18:16:14 +01:00
Henry Mercer
3c764cd93a Only create GitHub release if it doesn't already exist 2025-10-10 17:54:08 +01:00
Henry Mercer
e1968324ff Merge branch 'releases/v4' into mergeback/v4.30.8-to-main-f443b600 2025-10-10 17:53:24 +01:00
Henry Mercer
2a6736cca7 Merge pull request #3200 from github/henrymercer/backport-hotfix
Revert "Rebuild" commit rather than "Update dependencies"
2025-10-10 17:47:40 +01:00
Henry Mercer
c8765c966b Revert "Rebuild" commit rather than "Update dependencies" 2025-10-10 17:23:02 +01:00
github-actions[bot]
61789e2fdb Rebuild 2025-10-10 15:59:22 +00:00
github-actions[bot]
5cd2d139cb Update changelog and version after v4.30.8 2025-10-10 15:55:20 +00:00
Michael B. Gale
f443b600d9 Merge pull request #3198 from github/update-v4.30.8-527f0f324
Merge main into releases/v4
2025-10-10 16:54:36 +01:00
github-actions[bot]
7a2cb623ed Update changelog for v4.30.8 2025-10-10 14:34:56 +00:00
Henry Mercer
527f0f324a Merge pull request #3195 from github/dependabot/npm_and_yarn/npm-minor-37415c9066
Bump the npm-minor group with 3 updates
2025-10-10 15:22:52 +01:00
Henry Mercer
f402506f0f Merge pull request #3196 from github/dependabot/github_actions/dot-github/workflows/actions-minor-945aab589d
Bump ruby/setup-ruby from 1.263.0 to 1.265.0 in /.github/workflows in the actions-minor group across 1 directory
2025-10-10 15:20:16 +01:00
Henry Mercer
f5e53f9476 Merge pull request #3197 from github/dependabot/github_actions/dot-github/workflows/github/codeql-action-4
Bump github/codeql-action from 3 to 4 in /.github/workflows
2025-10-10 15:13:23 +01:00
Michael B. Gale
4e90a42a3e Merge pull request #3193 from github/mbg/ff/tools-toolcache
Gate `tools: toolcache` behind FF
2025-10-10 15:09:00 +01:00
github-actions[bot]
413a4a4df1 Rebuild 2025-10-10 13:49:43 +00:00
dependabot[bot]
452186448a Bump github/codeql-action from 3 to 4 in /.github/workflows
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-10 13:48:11 +00:00
dependabot[bot]
eadf14bf6e 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.263.0 to 1.265.0
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](0481980f17...ab177d40ee)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-10 13:48:07 +00:00
github-actions[bot]
e1257b6fda Rebuild 2025-10-10 13:47:47 +00:00
dependabot[bot]
b516b1d4bc Bump the npm-minor group with 3 updates
Bumps the npm-minor group with 3 updates: [semver](https://github.com/npm/node-semver), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser).


Updates `semver` from 7.7.2 to 7.7.3
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.7.2...v7.7.3)

Updates `@typescript-eslint/eslint-plugin` from 8.45.0 to 8.46.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.45.0 to 8.46.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.46.0/packages/parser)

---
updated-dependencies:
- dependency-name: semver
  dependency-version: 7.7.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.46.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.46.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-10 13:46:16 +00:00
Henry Mercer
168b2dee16 Merge pull request #3194 from github/henrymercer-patch-1
Dependabot: Only group minor and patch updates
2025-10-10 14:44:22 +01:00
Michael B. Gale
4704ab1869 Fix swapped log levels 2025-10-10 14:42:09 +01:00
Michael B. Gale
dc2ced8385 Add tests for scenarios where the feature is unavailable 2025-10-10 14:39:59 +01:00
Michael B. Gale
5c752c85dd Add test macro for fallback tests 2025-10-10 14:39:58 +01:00
Henry Mercer
e74435a1da Dependabot: Only group minor and patch updates
Major updates are likely to include breaking changes and are worth reviewing individually.
2025-10-10 14:28:32 +01:00
Michael B. Gale
524b9a00e8 Fix log message swap 2025-10-10 14:04:39 +01:00
Michael B. Gale
a512fe0868 Gate tools: toolcache behind FF
Mainly to allow us to disable it, if needed.
2025-10-10 13:49:06 +01:00
Michael B. Gale
62f0f21c3c Add AllowToolcacheInput feature 2025-10-10 13:27:50 +01:00
Paolo Tranquilli
a8440d08d5 Merge pull request #3185 from github/redsun82/skip-sarif-upload-tests
Add unit tests for `uploadPayload`
2025-10-10 14:00:05 +02:00
Paolo Tranquilli
610c7c68e3 Address review 2025-10-09 15:24:02 +02:00
Paolo Tranquilli
ff2fc66cc1 Simplify uploadPayload tests 2025-10-09 12:31:00 +02:00
Paolo Tranquilli
a841c540b7 Scratch uploadSpecifiedFiles tests, make uploadPayload tests instead 2025-10-09 12:18:14 +02:00
Paolo Tranquilli
aeb12f6eaa Merge branch 'main' into redsun82/skip-sarif-upload-tests 2025-10-09 11:38:10 +02:00
Henry Mercer
6fd4ceb7bb Merge pull request #3189 from github/henrymercer/download-codeql-rate-limit
Add configuration error for rate limited CodeQL download
2025-10-08 15:11:29 +01:00
Michael B. Gale
196a3e577b Merge pull request #3188 from github/mbg/telemetry/partial-config
Allow `Partial<Config>` for `createStatusReportBase`
2025-10-08 14:59:05 +01:00
Henry Mercer
98abb870dc Add configuration error for rate limited CodeQL download 2025-10-08 14:43:54 +01:00
Michael B. Gale
bdd2cdf891 Also include language in error status report for start-proxy, if available 2025-10-08 13:13:04 +01:00
Michael B. Gale
fb148789ab Include languages in start-proxy telemetry 2025-10-08 13:01:35 +01:00
Michael B. Gale
2ff418f28a Parse language before calling getCredentials 2025-10-08 13:01:35 +01:00
Michael B. Gale
527501d15d Allow createStatusReportBase to accept a Partial<Config> 2025-10-08 13:01:35 +01:00
Paolo Tranquilli
621809b239 Address copilot review 2025-10-08 12:24:49 +02:00
Paolo Tranquilli
8301b8b096 Merge pull request #3180 from github/redsun82/skip-sarif-upload
Introduce `CODEQL_ACTION_SKIP_SARIF_UPLOAD`
2025-10-08 12:09:54 +02:00
Nick Rolfe
7bdfa9736a Merge pull request #3184 from github/nickrolfe/go-overlay
Overlays: allow any build mode for Go
2025-10-08 10:48:40 +01:00
Paolo Tranquilli
a57997f2d2 Fix test after rebase 2025-10-08 09:34:48 +02:00
Paolo Tranquilli
4489a63a9d Add unit tests for uploadSpecifiedFiles 2025-10-08 09:34:48 +02:00
Paolo Tranquilli
1707898e5b Merge branch 'main' into redsun82/skip-sarif-upload 2025-10-08 09:34:05 +02:00
Paolo Tranquilli
d05f2255a0 Tweak comment 2025-10-08 09:34:01 +02:00
Nick Rolfe
7892cb2362 Overlays: allow any build mode for Go
We have a check that a traced language can only run overlay analysis
with build-mode: none, but Go does not currently declare support for
BMN, even though it has a similar autobuild mode that will work for
overlay analysis.

This commit adds a hard-coded exception to that check, allowing any
build mode for Go. This is intended as a short-term solution until Go
declares BMN support. It should be safe, since we can choose not to
enable the feature flag for Go repos using traced builds.
2025-10-07 17:45:08 +01:00
Mario Campos
8a6b62bc2d Merge pull request #3186 from github/mergeback/v4.30.7-to-main-e296a935
Mergeback v4.30.7 refs/heads/releases/v4 into main
2025-10-07 11:20:49 -05:00
github-actions[bot]
d95a3b53f8 Rebuild 2025-10-07 16:01:48 +00:00
github-actions[bot]
257e42ce3d Merge remote-tracking branch 'origin/main' into mergeback/v4.30.7-to-main-e296a935 2025-10-07 16:01:00 +00:00
github-actions[bot]
074940162c Update changelog and version after v4.30.7 2025-10-07 15:22:00 +00:00
Mario Campos
e296a93559 Merge pull request #3183 from github/update-v4.30.7-55283843c
Merge main into releases/v4
2025-10-07 10:21:14 -05:00
Paolo Tranquilli
df65651d4f Merge branch 'main' into redsun82/skip-sarif-upload 2025-10-07 17:17:13 +02:00
Paolo Tranquilli
1b09eb4ccc Address review 2025-10-07 17:17:06 +02:00
Michael B. Gale
2f11c17b09 Merge pull request #3175 from github/mbg/setup/toolcache
Support requesting latest version from toolcache with `tools: toolcache`
2025-10-07 10:32:03 +01:00
Michael B. Gale
0ba4970165 Merge branch 'main' into mbg/setup/toolcache 2025-10-07 10:09:12 +01:00
Michael B. Gale
5431b6a308 Merge pull request #3176 from github/mbg/pr-template/tests
Add more questions to the PR template
2025-10-07 10:05:07 +01:00
Michael B. Gale
7f5db167b6 Merge branch 'main' into mbg/pr-template/tests 2025-10-07 09:48:29 +01:00
Michael B. Gale
239d7b286f Merge pull request #3181 from github/mbg/pr-checks/upload-sarif
Add more end-to-end tests for `upload-sarif`
2025-10-07 09:48:05 +01:00
Paolo Tranquilli
86b2ad6646 Remove unneeded comment 2025-10-07 10:36:45 +02:00
Paolo Tranquilli
5dfb610e99 Merge branch 'main' into redsun82/skip-sarif-upload 2025-10-07 10:36:12 +02:00
Henry Mercer
1491baa17e Merge branch 'main' into mbg/pr-checks/upload-sarif 2025-10-07 09:28:42 +01:00
Henry Mercer
db562a696f Merge pull request #3182 from github/dependabot/npm_and_yarn/npm-b02b6854f6
Bump the npm group with 4 updates
2025-10-07 09:16:58 +01:00
github-actions[bot]
93c16735fa Update changelog for v4.30.7 2025-10-06 18:19:26 +00:00
Mario Campos
55283843ca Merge pull request #3169 from github/mario-campos/node24
[v4] Upgrade Node.js runtime from v20 to v24
2025-10-06 12:52:46 -05:00
github-actions[bot]
6877465dc1 Rebuild 2025-10-06 17:03:52 +00:00
dependabot[bot]
ff23a55f4d Bump the npm group with 4 updates
Bumps the npm group with 4 updates: [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js), [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin), [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) and [typescript](https://github.com/microsoft/TypeScript).


Updates `@eslint/js` from 9.36.0 to 9.37.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/commits/v9.37.0/packages/js)

Updates `@typescript-eslint/eslint-plugin` from 8.44.1 to 8.45.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.45.0/packages/eslint-plugin)

Updates `@typescript-eslint/parser` from 8.44.1 to 8.45.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.45.0/packages/parser)

Updates `typescript` from 5.9.2 to 5.9.3
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release-publish.yml)
- [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.2...v5.9.3)

---
updated-dependencies:
- dependency-name: "@eslint/js"
  dependency-version: 9.37.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-version: 8.45.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: "@typescript-eslint/parser"
  dependency-version: 8.45.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm
- dependency-name: typescript
  dependency-version: 5.9.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-06 17:02:21 +00:00
Mario Campos
b66db86c84 Hoist CHANGELOG note back to "UNRELEASED" section. 2025-10-06 11:40:43 -05:00
Paolo Tranquilli
00a6e13cbf Tweak SARIF skipping logs 2025-10-06 17:03:29 +02:00
Paolo Tranquilli
25c8db918a Revert "Specify reason for skipping SARIF upload in logs"
This reverts commit 680b07003d.
2025-10-06 16:59:45 +02:00
Michael B. Gale
dabf6fc578 Adjust step names to be clearer 2025-10-06 15:40:35 +01:00
Michael B. Gale
14c5d77032 Fix: Update payload.json path in with-checkout-path test 2025-10-06 15:28:40 +01:00
Michael B. Gale
380e002752 Add explicit category values 2025-10-06 15:15:43 +01:00
Paolo Tranquilli
680b07003d Specify reason for skipping SARIF upload in logs 2025-10-06 15:39:29 +02:00
Michael B. Gale
22aba57acf Include analysis kind in payloadSaveFile path in uploadPayload 2025-10-06 14:30:30 +01:00
Paolo Tranquilli
11e4034414 Clarify comment about SKIP_SARIF_UPLOAD setting 2025-10-06 15:23:18 +02:00
Paolo Tranquilli
882667e383 Update src/util.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-06 15:22:34 +02:00
Michael B. Gale
6f964b7776 Cover more cases in upload-sarif check 2025-10-06 14:10:49 +01:00
Michael B. Gale
6bdf5d3d00 Run upload-sarif check for all analysis-kinds values 2025-10-06 13:56:19 +01:00
Michael B. Gale
9b3ade946d Rename upload-quality-sarif.yml workflow 2025-10-06 13:50:21 +01:00
Paolo Tranquilli
e0b9da7b0a Introduce CODEQL_ACTION_SKIP_SARIF_UPLOAD
This triggers a subset of the behavior of `CODEQL_ACTION_TEST_MODE`,
specifically just skipping the SARIF upload step. This is required for
our internal testing where we want the SARIF file (via
`CODEQL_ACTION_DUMP_SARIF_DIR`) but don't want to actually upload it,
but we don't want the rest of the behaviour of `CODEQL_ACTION_TEST_MODE`
that is specific for `codeql-action` own CI checks.
2025-10-06 14:38:32 +02:00
Michael B. Gale
726a341ed4 Restrict when tools: toolcache can be used 2025-10-06 13:16:16 +01:00
Michael B. Gale
1cc5eb6636 Use semver.compare instead of semver.lt 2025-10-06 12:58:00 +01:00
Michael B. Gale
43ce7ef399 Add isDynamicWorkflow function 2025-10-06 12:55:54 +01:00
Michael B. Gale
4d0c164f60 Remove toolcache option description from action.yml 2025-10-06 12:53:17 +01:00
Mario Campos
b2e22323e2 Merge remote-tracking branch 'origin/main' into mario-campos/node24
# Conflicts:
#	lib/analyze-action-post.js
#	lib/analyze-action.js
#	lib/autobuild-action.js
#	lib/init-action-post.js
#	lib/init-action.js
#	lib/resolve-environment-action.js
#	lib/start-proxy-action-post.js
#	lib/start-proxy-action.js
#	lib/upload-lib.js
#	lib/upload-sarif-action-post.js
#	lib/upload-sarif-action.js
#	package-lock.json
#	package.json
2025-10-03 12:59:21 -05:00
Michael B. Gale
dd9e24a8a4 Add more questions to the PR template 2025-10-03 16:27:36 +01:00
Michael B. Gale
13a3a6890f Add basic PR check for tools: toolcache 2025-10-03 15:49:29 +01:00
Michael B. Gale
7d468c931c Accept toolcache as version value for prepare-test 2025-10-03 15:48:04 +01:00
Michael B. Gale
425ef85595 Support requesting CLI from toolcache with tools: toolcache 2025-10-03 15:40:33 +01:00
Michael B. Gale
297313df79 Add getLatestToolcacheVersion with tests 2025-10-03 14:40:34 +01:00
Michael B. Gale
065c6cfb78 Merge pull request #3174 from github/mbg/fix/start-proxy-matrix
Make `matrix` available to `start-proxy` action
2025-10-03 12:26:10 +01:00
Michael B. Gale
7fb8378d93 Re-throw exception in createStatusReportBase when in test mode 2025-10-03 11:59:36 +01:00
Mario Campos
dddf033776 Revert changes to build.mjs 2025-10-02 14:32:40 -05:00
Mario Campos
54ae8ba5b1 Simplify PR check by reverting changes to @types/node. 2025-10-02 14:24:46 -05:00
Michael B. Gale
65e9e640ee Make matrix available to start-proxy action 2025-10-02 17:45:22 +01:00
Nick Rolfe
21a7ba37dd Merge pull request #3173 from github/mergeback/v3.30.6-to-main-64d10c13
Mergeback v3.30.6 refs/heads/releases/v3 into main
2025-10-02 15:15:57 +01:00
github-actions[bot]
70836b1ec4 Rebuild 2025-10-02 13:55:07 +00:00
github-actions[bot]
205744e04f Update changelog and version after v3.30.6 2025-10-02 13:53:03 +00:00
Henry Mercer
d899b2ed98 Merge branch 'main' into mario-campos/node24 2025-10-02 12:36:53 +01:00
Mario Campos
3adb1ff7b8 Reorder supported tags in descending order
Co-authored-by: Henry Mercer <henrymercer@github.com>
2025-10-01 09:04:18 -05:00
Mario Campos
d4b5380db4 Document Node.js 24 change in CHANGELOG.md. 2025-09-30 14:11:13 -05:00
Mario Campos
d4bbcb74ca Implement simultaneous PR checks for Node.js v20, v24.
Copied from #2006.
2025-09-30 14:11:13 -05:00
Mario Campos
180438161e Specify Node.js v24 in actions/setup-node steps. 2025-09-30 14:11:13 -05:00
Mario Campos
d7ada03e02 Downgrade upload-sarif@v4 -> v3
I got ahead of myself; v4 hasn't been tagged yet.
2025-09-30 14:11:13 -05:00
Mario Campos
30445af89f Rebuild JS after upgrading to Node.js 24. 2025-09-30 14:11:04 -05:00
Mario Campos
7434149006 Upgrade Node.js version to 24.
This requires creating a new major-version (v4) of codeql-action.
2025-09-30 13:56:31 -05:00
151 changed files with 170956 additions and 73670 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: node20
using: node24
main: index.js

View File

@@ -2,7 +2,7 @@ name: "Prepare test"
description: Performs some preparation to run tests
inputs:
version:
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'nightly', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z"
description: "The version of the CodeQL CLI to use. Can be 'linked', 'default', 'toolcache', 'nightly', 'nightly-latest', 'nightly-YYYYMMDD', or 'stable-vX.Y.Z"
required: true
use-all-platform-bundle:
description: "If true, we output a tools URL with codeql-bundle.tar.gz file rather than platform-specific URL"
@@ -41,6 +41,9 @@ runs:
elif [[ "$VERSION" == "linked" ]]; then
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
exit 0
elif [[ "$VERSION" == "toolcache" ]]; then
echo "tools-url=toolcache" >> "$GITHUB_OUTPUT"
exit 0
elif [[ "$VERSION" == "default" ]]; then
echo "tools-url=" >> "$GITHUB_OUTPUT"
exit 0

View File

@@ -16,9 +16,9 @@ runs:
shell: bash
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.12
python-version: '3.12'
- name: Install dependencies
run: |

View File

@@ -16,9 +16,12 @@ updates:
- dependency-name: "eslint-plugin-import"
versions: [">=2.30.0"]
groups:
npm:
npm-minor:
patterns:
- "*"
update-types:
- "minor"
- "patch"
- package-ecosystem: github-actions
directories:
- "/.github/workflows"
@@ -28,6 +31,9 @@ updates:
labels:
- Rebuild
groups:
actions:
actions-minor:
patterns:
- "*"
update-types:
- "minor"
- "patch"

View File

@@ -1,4 +1,13 @@
<!-- For GitHub staff: Remember that this is a public repository. -->
<!--
For GitHub staff: Remember that this is a public repository. Do not link to internal resources.
If necessary, link to this PR from an internal issue and include further details there.
Everyone: Include a summary of the context of this change, what it aims to accomplish, and why you
chose the approach you did if applicable. Indicate any open questions you want to answer
during the review process and anything you want reviewers to pay particular attention to.
See https://github.com/github/codeql-action/blob/main/CONTRIBUTING.md for additional information.
-->
### Risk assessment
@@ -7,6 +16,44 @@ For internal use only. Please select the risk level of this change:
- **Low risk:** Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.
- **High risk:** Changes are not fully under feature flags, have limited visibility and/or cannot be tested outside of production.
#### Which use cases does this change impact?
<!-- Delete options that don't apply. -->
- **Advanced setup** - Impacts users who have custom workflows.
- **Default setup** - Impacts users who use default setup.
- **Code Scanning** - Impacts Code Scanning (i.e. `analysis-kinds: code-scanning`).
- **Code Quality** - Impacts Code Quality (i.e. `analysis-kinds: code-quality`).
- **Third-party analyses** - Impacts third-party analyses (i.e. `upload-sarif`).
- **GHES** - Impacts GitHub Enterprise Server.
#### How did/will you validate this change?
<!-- Delete options that don't apply. -->
- **Test repository** - This change will be tested on a test repository before merging.
- **Unit tests** - I am depending on unit test coverage (i.e. tests in `.test.ts` files).
- **End-to-end tests** - I am depending on PR checks (i.e. tests in `pr-checks`).
- **Other** - Please provide details.
- **None** - I am not validating these changes.
#### If something goes wrong after this change is released, what are the mitigation and rollback strategies?
<!-- Delete strategies that don't apply. -->
- **Feature flags** - All new or changed code paths can be fully disabled with corresponding feature flags.
- **Rollback** - Change can only be disabled by rolling back the release or releasing a new version with a fix.
- **Other** - Please provide details.
#### How will you know if something goes wrong after this change is released?
<!-- Delete options that don't apply. -->
- **Telemetry** - I rely on existing telemetry or have made changes to the telemetry.
- **Dashboards** - I will watch relevant dashboards for issues after the release. Consider whether this requires this change to be released at a particular time rather than as part of a regular release.
- **Alerts** - New or existing monitors will trip if something goes wrong with this change.
- **Other** - Please provide details.
### Merge / deployment checklist
- Confirm this change is backwards compatible with existing workflows.

55
.github/sizeup.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
labeling:
applyCategoryLabels: true
categoryLabelPrefix: "size/"
commenting:
addCommentWhenScoreThresholdHasBeenExceeded: false
sizeup:
categories:
- name: extra small
lte: 25
label:
name: XS
description: Should be very easy to review
color: 3cbf00
- name: small
lte: 100
label:
name: S
description: Should be easy to review
color: 5d9801
- name: medium
lte: 250
label:
name: M
description: Should be of average difficulty to review
color: 7f7203
- name: large
lte: 500
label:
name: L
description: May be hard to review
color: a14c05
- name: extra large
lte: 1000
label:
name: XL
description: May be very hard to review
color: c32607
- name: extra extra large
label:
name: XXL
description: May be extremely hard to review
color: e50009
ignoredFilePatterns:
- ".github/workflows/__*"
- "lib/**/*"
- "package-lock.json"
testFilePatterns:
- "**/*.test.ts"
scoring:
# This formula and the aliases below it are written in prefix notation.
# For an explanation of how this works, please see:
# https://github.com/lerebear/sizeup-core/blob/main/README.md#prefix-notation
formula: "- - + additions deletions comments whitespace"

View File

@@ -371,10 +371,10 @@ def main():
# releases.
run_git('revert', vOlder_update_commits[0], '--no-edit')
# Also revert the "Update checked-in dependencies" commit created by Actions.
update_dependencies_commit = run_git('log', '--grep', '^Update checked-in dependencies', '--format=%H').split()[0]
print(f' Reverting {update_dependencies_commit}')
run_git('revert', update_dependencies_commit, '--no-edit')
# Also revert the "Rebuild" commit created by Actions.
rebuild_commit = run_git('log', '--grep', '^Rebuild$', '--format=%H').split()[0]
print(f' Reverting {rebuild_commit}')
run_git('revert', rebuild_commit, '--no-edit')
else:
print(' Nothing to revert.')

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -70,6 +80,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: 'PR Check - Upload-sarif: code quality endpoint'
name: 'PR Check - Bundle: From toolcache'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -21,19 +21,9 @@ on:
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
inputs: {}
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
inputs: {}
defaults:
run:
shell: bash
@@ -41,14 +31,14 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
upload-quality-sarif:
bundle-from-toolcache:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: default
name: 'Upload-sarif: code quality endpoint'
version: toolcache
name: 'Bundle: From toolcache'
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -65,31 +55,31 @@ jobs:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install Go
uses: actions/setup-go@v6
- name: Install @actions/tool-cache
run: npm install @actions/tool-cache
- name: Check toolcache contains CodeQL
continue-on-error: true
uses: actions/github-script@v8
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- uses: ./../action/init
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
if (allCodeqlVersions.length === 0) {
throw new Error(`CodeQL could not be found in the toolcache`);
}
- id: setup-codeql
uses: ./../action/setup-codeql
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: csharp,java,javascript,python
analysis-kinds: code-quality
- name: Build code
run: ./build.sh
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
- name: Check CodeQL is installed within the toolcache
uses: actions/github-script@v8
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
upload: never
- uses: ./../action/upload-sarif
id: upload-sarif
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
- name: Check output from `upload-sarif` step
if: '!(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)'
run: exit 1
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
if (allCodeqlVersions.length === 0) {
throw new Error('CodeQL not found in toolcache');
}
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -79,7 +79,7 @@ jobs:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.os }}-zstd-bundle.sarif
path: ${{ runner.temp }}/results/javascript.sarif

View File

@@ -67,7 +67,7 @@ jobs:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif

View File

@@ -49,7 +49,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: npm

View File

@@ -78,7 +78,7 @@ jobs:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif

View File

@@ -85,7 +85,7 @@ jobs:
with:
output: ${{ runner.temp }}/results
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif

View File

@@ -64,7 +64,7 @@ jobs:
with:
output: ${{ runner.temp }}/results
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: ${{ runner.temp }}/results/javascript.sarif

15
.github/workflows/__local-bundle.yml generated vendored
View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -70,6 +80,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Fetch latest CodeQL bundle
run: |
wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -104,6 +114,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Use Xcode 16
if: runner.os == 'macOS' && matrix.version != 'nightly-latest'
run: sudo xcode-select -s "/Applications/Xcode_16.app"

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -63,7 +73,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: npm
@@ -81,6 +91,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- uses: ./../action/init
with:
config-file: .github/codeql/codeql-config-packaging3.yml

View File

@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: npm

View File

@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: npm

View File

@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20.x
cache: npm

View File

@@ -80,9 +80,10 @@ jobs:
with:
output: ${{ runner.temp }}/results
upload-database: false
post-processed-sarif-path: ${{ runner.temp }}/post-processed
- name: Upload security SARIF
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: |
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
@@ -90,12 +91,20 @@ jobs:
retention-days: 7
- name: Upload quality SARIF
if: contains(matrix.analysis-kinds, 'code-quality')
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: |
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.quality.sarif.json
path: ${{ runner.temp }}/results/javascript.quality.sarif
retention-days: 7
- name: Upload post-processed SARIF
uses: actions/upload-artifact@v5
with:
name: |
post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
path: ${{ runner.temp }}/post-processed
retention-days: 7
if-no-files-found: error
- name: Check quality query does not appear in security SARIF
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/github-script@v8

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -72,6 +82,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}

View File

@@ -56,7 +56,7 @@ jobs:
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Set up Ruby
uses: ruby/setup-ruby@0481980f17b760ef6bca5e8c55809102a0af1e5a # v1.263.0
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
with:
ruby-version: 2.6
- name: Install Code Scanning integration

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -72,6 +82,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- uses: ./../action/init
id: init
with:

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -70,6 +80,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}

173
.github/workflows/__upload-sarif.yml generated vendored Normal file
View File

@@ -0,0 +1,173 @@
# 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 - Test different uses of `upload-sarif`
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
- cron: '0 5 * * *'
workflow_dispatch:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
type: string
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
upload-sarif:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
version: default
analysis-kinds: code-scanning
- os: ubuntu-latest
version: default
analysis-kinds: code-quality
- os: ubuntu-latest
version: default
analysis-kinds: code-scanning,code-quality
name: Test different uses of `upload-sarif`
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@v5
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: 'false'
setup-kotlin: 'true'
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: csharp,java,javascript,python
analysis-kinds: ${{ matrix.analysis-kinds }}
- name: Build code
run: ./build.sh
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
upload: never
output: ${{ runner.temp }}/results
- name: |
Upload all SARIF files for `analysis-kinds: ${{ matrix.analysis-kinds }}`
uses: ./../action/upload-sarif
id: upload-sarif
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
sarif_file: ${{ runner.temp }}/results
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:all-files/
- name: Fail for missing output from `upload-sarif` step for `code-scanning`
if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-scanning)
run: exit 1
- name: Fail for missing output from `upload-sarif` step for `code-quality`
if: contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)
run: exit 1
- name: Upload single SARIF file for Code Scanning
uses: ./../action/upload-sarif
id: upload-single-sarif-code-scanning
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
sarif_file: ${{ runner.temp }}/results/javascript.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-scanning/
- name: Fail for missing output from `upload-single-sarif-code-scanning` step
if: contains(matrix.analysis-kinds, 'code-scanning') &&
!(fromJSON(steps.upload-single-sarif-code-scanning.outputs.sarif-ids).code-scanning)
run: exit 1
- name: Upload single SARIF file for Code Quality
uses: ./../action/upload-sarif
id: upload-single-sarif-code-quality
if: contains(matrix.analysis-kinds, 'code-quality')
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
sarif_file: ${{ runner.temp }}/results/javascript.quality.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-quality/
- name: Fail for missing output from `upload-single-sarif-code-quality` step
if: contains(matrix.analysis-kinds, 'code-quality') &&
!(fromJSON(steps.upload-single-sarif-code-quality.outputs.sarif-ids).code-quality)
run: exit 1
- name: Change SARIF file extension
if: contains(matrix.analysis-kinds, 'code-scanning')
run: mv ${{ runner.temp }}/results/javascript.sarif ${{ runner.temp }}/results/javascript.sarif.json
- name: Upload single non-`.sarif` file
uses: ./../action/upload-sarif
id: upload-single-non-sarif
if: contains(matrix.analysis-kinds, 'code-scanning')
with:
ref: refs/heads/main
sha: 5e235361806c361d4d3f8859e3c897658025a9a2
sarif_file: ${{ runner.temp }}/results/javascript.sarif.json
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:non-sarif/
- name: Fail for missing output from `upload-single-non-sarif` step
if: contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-non-sarif.outputs.sarif-ids).code-scanning)
run: exit 1
env:
CODEQL_ACTION_TEST_MODE: true

View File

@@ -27,6 +27,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
workflow_call:
inputs:
go-version:
@@ -34,6 +39,11 @@ on:
description: The version of Go to install
required: false
default: '>=1.21.0'
python-version:
type: string
description: The version of Python to install
required: false
default: '3.13'
defaults:
run:
shell: bash
@@ -70,6 +80,11 @@ jobs:
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
- name: Install Python
if: matrix.version != 'nightly-latest'
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version || '3.13' }}
- name: Delete original checkout
run: |
# delete the original checkout so we don't accidentally use it.
@@ -103,29 +118,30 @@ jobs:
- name: Verify SARIF after upload
run: |
PAYLOAD_FILE="$RUNNER_TEMP/payload-code-scanning.json"
EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6"
EXPECTED_REF="v1.1.0"
EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo"
ACTUAL_COMMIT_OID="$(cat "$RUNNER_TEMP/payload.json" | jq -r .commit_oid)"
ACTUAL_REF="$(cat "$RUNNER_TEMP/payload.json" | jq -r .ref)"
ACTUAL_CHECKOUT_URI="$(cat "$RUNNER_TEMP/payload.json" | jq -r .checkout_uri)"
ACTUAL_COMMIT_OID="$(cat "$PAYLOAD_FILE" | jq -r .commit_oid)"
ACTUAL_REF="$(cat "$PAYLOAD_FILE" | jq -r .ref)"
ACTUAL_CHECKOUT_URI="$(cat "$PAYLOAD_FILE" | jq -r .checkout_uri)"
if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then
echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID"
echo "$RUNNER_TEMP/payload.json"
echo "$PAYLOAD_FILE"
exit 1
fi
if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then
echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'"
echo "$RUNNER_TEMP/payload.json"
echo "$PAYLOAD_FILE"
exit 1
fi
if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then
echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI"
echo "$RUNNER_TEMP/payload.json"
echo "$PAYLOAD_FILE"
exit 1
fi
env:

View File

@@ -15,7 +15,7 @@ defaults:
jobs:
check-expected-release-files:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
contents: read

View File

@@ -81,7 +81,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-13,macos-14,macos-15]
os: [ubuntu-22.04,ubuntu-24.04,windows-2022,windows-2025,macos-14,macos-15]
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}

View File

@@ -56,9 +56,9 @@ jobs:
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: 24
cache: 'npm'
- name: Install dependencies

View File

@@ -79,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
- name: Check expected artifacts exist
run: |
LANGUAGES="cpp csharp go java javascript python"

View File

@@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
- name: Check expected artifacts exist
run: |
VERSIONS="stable-v2.20.3 default linked nightly-latest"

26
.github/workflows/label-pr-size.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Label PR with size
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
- ready_for_review
permissions:
contents: read
pull-requests: write
jobs:
sizeup:
name: Label PR with size
runs-on: ubuntu-slim
steps:
- name: Run sizeup
uses: lerebear/sizeup-action@b7beb3dd273e36039e16e48e7bc690c189e61951 # 0.8.12
with:
token: "${{ secrets.GITHUB_TOKEN }}"
configuration-file-path: ".github/sizeup.yml"

View File

@@ -24,7 +24,7 @@ defaults:
jobs:
merge-back:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
environment: Automation
if: github.repository == 'github/codeql-action'
env:
@@ -47,7 +47,10 @@ jobs:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # ensure we have all tags and can push commits
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Update git config
run: |
@@ -146,6 +149,7 @@ jobs:
private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }}
- name: Create the GitHub release
if: steps.check.outputs.exists != 'true'
env:
PARTIAL_CHANGELOG: "${{ runner.temp }}/partial_changelog.md"
VERSION: "${{ steps.getVersion.outputs.version }}"

View File

@@ -20,6 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [20, 24]
permissions:
contents: read
security-events: write # needed to upload ESLint results
@@ -34,9 +35,9 @@ jobs:
- uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: '20.x'
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Set up Python
@@ -72,8 +73,8 @@ jobs:
run: npm run lint-ci
- name: Upload sarif
uses: github/codeql-action/upload-sarif@v3
if: matrix.os == 'ubuntu-latest'
uses: github/codeql-action/upload-sarif@v4
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
with:
sarif_file: eslint.sarif
category: eslint

View File

@@ -29,7 +29,7 @@ defaults:
jobs:
prepare:
name: "Prepare release"
runs-on: ubuntu-latest
runs-on: ubuntu-slim
if: github.repository == 'github/codeql-action'
permissions:

View File

@@ -1,8 +1,10 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
push:
tags:
# Match version tags, but not the major version tags.
- 'v[0-9]+.**'
defaults:
run:
@@ -10,30 +12,16 @@ defaults:
jobs:
publish:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Check release name
id: check
env:
RELEASE_NAME: ${{ github.event.release.name }}
run: |
echo "Release name: ${{ github.event.release.name }}"
if [[ $RELEASE_NAME == v* ]]; then
echo "This is a CodeQL Action release. Create an Immutable Action"
echo "is-action-release=true" >> $GITHUB_OUTPUT
else
echo "This is a CodeQL Bundle release. Do not create an Immutable Action"
echo "is-action-release=false" >> $GITHUB_OUTPUT
fi
- name: Checking out
if: steps.check.outputs.is-action-release == 'true'
- name: Checkout repository
uses: actions/checkout@v5
- name: Publish
if: steps.check.outputs.is-action-release == 'true'
- name: Publish immutable release
id: publish
uses: actions/publish-immutable-action@v0.0.4

View File

@@ -32,9 +32,9 @@ jobs:
uses: actions/checkout@v5
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20.x
node-version: 24
cache: npm
- name: Install dependencies

View File

@@ -0,0 +1,18 @@
import os
import re
# Get the PR number from the PR URL.
pr_number = os.environ['PR_URL'].split('/')[-1]
changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})"
# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
with open('CHANGELOG.md', 'r') as f:
changelog = f.read()
changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n')
# Add the changelog note to the bottom of the "[UNRELEASED]" section.
changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1)
with open('CHANGELOG.md', 'w') as f:
f.write(changelog)

View File

@@ -29,7 +29,7 @@ fi
echo "Getting checks for $GITHUB_SHA"
# Ignore any checks with "https://", CodeQL, LGTM, Update, and ESLint checks.
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") | not)] | unique | sort')"
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") or . == "Agent" or . == "Cleanup artifacts" or . == "Prepare" or . == "Upload results" | not)] | unique | sort')"
echo "$CHECKS" | jq

View File

@@ -20,7 +20,7 @@ defaults:
jobs:
update-bundle:
if: github.event.release.prerelease && startsWith(github.event.release.tag_name, 'codeql-bundle-')
runs-on: ubuntu-latest
runs-on: ubuntu-slim
permissions:
contents: write # needed to push commits
pull-requests: write # needed to create pull requests
@@ -40,10 +40,15 @@ jobs:
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Set up Node.js
uses: actions/setup-node@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
node-version: '20.x'
python-version: '3.12'
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
- name: Install dependencies
@@ -78,28 +83,8 @@ jobs:
echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV"
- name: Create changelog note
shell: python
run: |
import os
import re
# Get the PR number from the PR URL.
pr_number = os.environ['PR_URL'].split('/')[-1]
changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})"
# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line.
# Use perl to avoid having to escape the newline character.
with open('CHANGELOG.md', 'r') as f:
changelog = f.read()
changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n')
# Add the changelog note to the bottom of the "[UNRELEASED]" section.
changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1)
with open('CHANGELOG.md', 'w') as f:
f.write(changelog)
python .github/workflows/script/bundle_changelog.py
- name: Push changelog note
run: |

View File

@@ -26,7 +26,7 @@ jobs:
update:
timeout-minutes: 45
runs-on: ubuntu-latest
runs-on: ubuntu-slim
if: github.event_name == 'workflow_dispatch'
needs: [prepare]
env:
@@ -77,7 +77,7 @@ jobs:
backport:
timeout-minutes: 45
runs-on: ubuntu-latest
runs-on: ubuntu-slim
environment: Automation
needs: [prepare]
if: ${{ (github.event_name == 'push') && needs.prepare.outputs.backport_target_branches != '[]' }}

View File

@@ -9,7 +9,7 @@ jobs:
update-supported-enterprise-server-versions:
name: Update Supported Enterprise Server Versions
timeout-minutes: 45
runs-on: ubuntu-latest
runs-on: ubuntu-slim
if: github.repository == 'github/codeql-action'
permissions:
contents: write # needed to push commits

View File

@@ -2,6 +2,36 @@
See the [releases page](https://github.com/github/codeql-action/releases) for the relevant changes to the CodeQL CLI and language packs.
## [UNRELEASED]
- 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/).
## 4.31.2 - 30 Oct 2025
No user facing changes.
## 4.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
- 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
- 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
No user facing changes.
## 4.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)
## 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

@@ -13,7 +13,7 @@ Please note that this project is released with a [Contributor Code of Conduct][c
## Development and Testing
Before you start, ensure that you have a recent version of node (16 or higher) installed, along with a recent version of npm (9.2 or higher). You can see which version of node is used by the action in `init/action.yml`.
Before you start, ensure that you have a recent version of node (24 or higher) installed, along with a recent version of npm (9.2 or higher). You can see which version of node is used by the action in `init/action.yml`.
### Common tasks

View File

@@ -34,6 +34,7 @@ Actions with special purposes and unlikely to be used directly:
- `autobuild`: Attempts to automatically build the code. Only used for analyzing languages that require a build. Use the `build-mode: autobuild` input in the `init` action instead. For information about input parameters, see the [autobuild action definition](https://github.com/github/codeql-action/blob/main/autobuild/action.yml).
- `resolve-environment`: [Experimental] Attempts to infer a build environment suitable for automatic builds. For information about input parameters, see the [resolve-environment action definition](https://github.com/github/codeql-action/blob/main/resolve-environment/action.yml).
- `start-proxy`: [Experimental] Start the HTTP proxy server. Internal use only and will change without notice. For information about input parameters, see the [start-proxy action definition](https://github.com/github/codeql-action/blob/main/start-proxy/action.yml).
- `setup-codeql`: [Experimental] Similar to `init`, except it only installs the CodeQL CLI and does not initialize a database.
### Workflow Permissions
@@ -62,7 +63,8 @@ For compiled languages:
The following versions of the CodeQL Action are currently supported:
- v3 (latest)
- v4 (latest)
- v3
## Supported versions of the CodeQL Bundle on GitHub Enterprise Server

View File

@@ -6,7 +6,7 @@ inputs:
description: The name of the check run to add text to.
required: false
output:
description: The path of the directory in which to save the SARIF results
description: The path of the directory in which to save the SARIF results from the CodeQL CLI.
required: false
default: "../results"
upload:
@@ -32,14 +32,10 @@ inputs:
and 13GB for macOS).
required: false
add-snippets:
description: Specify whether or not to add code snippets to the output sarif file.
description: Does not have any effect.
required: false
default: "false"
deprecationMessage: >-
The input "add-snippets" is deprecated and will be removed on the first release in August 2025.
When this input is set to true it is expected to add code snippets with an alert to the SARIF file.
However, since Code Scanning ignores code snippets provided as part of a SARIF file this is currently
a no operation. No alternative is available.
The input "add-snippets" has been removed and no longer has any effect.
skip-queries:
description: If this option is set, the CodeQL database will be built but no queries will be run on it. Thus, no results will be produced.
required: false
@@ -70,6 +66,12 @@ inputs:
description: Whether to upload the resulting CodeQL database
required: false
default: "true"
post-processed-sarif-path:
description: >-
Before uploading the SARIF files produced by the CodeQL CLI, the CodeQL Action may perform some post-processing
on them. Ordinarily, these post-processed SARIF files are not saved to disk. However, if a path is provided as an
argument for this input, they are written to the specified directory.
required: false
wait-for-processing:
description: If true, the Action will wait for the uploaded SARIF to be processed before completing.
required: true
@@ -92,6 +94,6 @@ outputs:
sarif-id:
description: The ID of the uploaded SARIF file.
runs:
using: node20
using: node24
main: "../lib/analyze-action.js"
post: "../lib/analyze-action-post.js"

View File

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

View File

@@ -12,6 +12,7 @@ import filenames from "eslint-plugin-filenames";
import github from "eslint-plugin-github";
import _import from "eslint-plugin-import";
import noAsyncForeach from "eslint-plugin-no-async-foreach";
import jsdoc from "eslint-plugin-jsdoc";
import globals from "globals";
const __filename = fileURLToPath(import.meta.url);
@@ -52,6 +53,7 @@ export default [
github: fixupPluginRules(github),
import: fixupPluginRules(_import),
"no-async-foreach": noAsyncForeach,
"jsdoc": jsdoc,
},
languageOptions: {
@@ -131,7 +133,18 @@ export default [
"no-sequences": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"one-var": ["error", "never"],
// Check param names to ensure that we don't have outdated JSDocs.
"jsdoc/check-param-names": [
"error",
{
// We don't currently require full JSDoc coverage, so this rule
// should not error on missing @param annotations.
disableMissingParamChecks: true,
}
],
},
},
{

View File

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

15230
lib/analyze-action-post.js generated

File diff suppressed because one or more lines are too long

16703
lib/analyze-action.js generated

File diff suppressed because it is too large Load Diff

7210
lib/autobuild-action.js generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.23.2",
"cliVersion": "2.23.2",
"priorBundleVersion": "codeql-bundle-v2.23.1",
"priorCliVersion": "2.23.1"
"bundleVersion": "codeql-bundle-v2.23.3",
"cliVersion": "2.23.3",
"priorBundleVersion": "codeql-bundle-v2.23.2",
"priorCliVersion": "2.23.2"
}

25636
lib/init-action-post.js generated

File diff suppressed because one or more lines are too long

15215
lib/init-action.js generated

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

86437
lib/setup-codeql-action.js generated Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6865
lib/start-proxy-action.js generated

File diff suppressed because it is too large Load Diff

13213
lib/upload-lib.js generated

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

13515
lib/upload-sarif-action.js generated

File diff suppressed because it is too large Load Diff

1909
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "3.30.6",
"version": "4.31.3",
"private": true,
"description": "CodeQL action",
"scripts": {
@@ -24,22 +24,20 @@
},
"license": "MIT",
"dependencies": {
"@actions/artifact": "^2.3.1",
"@actions/artifact": "^4.0.0",
"@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2",
"@actions/cache": "^4.1.0",
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/github": "^6.0.0",
"@actions/glob": "^0.5.0",
"@actions/http-client": "^2.2.3",
"@actions/io": "^1.1.3",
"@actions/http-client": "^3.0.0",
"@actions/io": "^2.0.0",
"@actions/tool-cache": "^2.0.2",
"@octokit/plugin-retry": "^6.0.0",
"@octokit/request-error": "^7.0.2",
"@schemastore/package": "0.0.10",
"archiver": "^7.0.1",
"check-disk-space": "^3.4.0",
"console-log-level": "^1.4.1",
"del": "^8.0.0",
"fast-deep-equal": "^3.1.3",
"follow-redirects": "^1.15.11",
"get-folder-size": "^5.0.0",
@@ -47,39 +45,39 @@
"jsonschema": "1.4.1",
"long": "^5.3.2",
"node-forge": "^1.3.1",
"octokit": "^5.0.3",
"semver": "^7.7.2",
"octokit": "^5.0.5",
"semver": "^7.7.3",
"uuid": "^13.0.0"
},
"devDependencies": {
"@ava/typescript": "6.0.0",
"@eslint/compat": "^1.4.0",
"@eslint/compat": "^1.4.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.36.0",
"@eslint/js": "^9.39.1",
"@microsoft/eslint-formatter-sarif": "^3.1.0",
"@octokit/types": "^15.0.0",
"@types/archiver": "^6.0.3",
"@types/console-log-level": "^1.4.5",
"@octokit/types": "^16.0.0",
"@types/archiver": "^7.0.0",
"@types/follow-redirects": "^1.14.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "20.19.9",
"@types/node-forge": "^1.3.14",
"@types/semver": "^7.7.1",
"@types/sinon": "^17.0.4",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/eslint-plugin": "^8.46.4",
"@typescript-eslint/parser": "^8.41.0",
"ava": "^6.4.1",
"esbuild": "^0.25.10",
"esbuild": "^0.27.0",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.8.7",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-github": "^5.1.8",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "^61.1.12",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^11.0.3",
"nock": "^14.0.10",
"sinon": "^21.0.0",
"typescript": "^5.9.2"
"typescript": "^5.9.3"
},
"overrides": {
"@actions/tool-cache": {

View File

@@ -2,6 +2,7 @@ name: "Analyze: 'ref' and 'sha' from inputs"
description: "Checks that specifying 'ref' and 'sha' as inputs works"
versions: ["default"]
installGo: true
installPython: true
steps:
- uses: ./../action/init
with:

View File

@@ -0,0 +1,31 @@
name: "Bundle: From toolcache"
description: "The CodeQL bundle should be cached within the toolcache"
versions:
- toolcache
steps:
- name: Install @actions/tool-cache
run: npm install @actions/tool-cache
- name: Check toolcache contains CodeQL
continue-on-error: true
uses: actions/github-script@v8
with:
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
if (allCodeqlVersions.length === 0) {
throw new Error(`CodeQL could not be found in the toolcache`);
}
- id: setup-codeql
uses: ./../action/setup-codeql
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check CodeQL is installed within the toolcache
uses: actions/github-script@v8
with:
script: |
const toolcache = require('@actions/tool-cache');
const allCodeqlVersions = toolcache.findAllVersions('CodeQL');
console.log(`Found CodeQL versions: ${allCodeqlVersions}`);
if (allCodeqlVersions.length === 0) {
throw new Error('CodeQL not found in toolcache');
}

View File

@@ -27,7 +27,7 @@ steps:
output: ${{ runner.temp }}/results
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.os }}-zstd-bundle.sarif
path: ${{ runner.temp }}/results/javascript.sarif

View File

@@ -12,7 +12,7 @@ steps:
output: "${{ runner.temp }}/results"
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: "${{ runner.temp }}/results/javascript.sarif"

View File

@@ -25,7 +25,7 @@ steps:
output: "${{ runner.temp }}/results"
upload-database: false
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: "${{ runner.temp }}/results/javascript.sarif"

View File

@@ -17,7 +17,7 @@ steps:
with:
output: "${{ runner.temp }}/results"
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: "${{ runner.temp }}/results/javascript.sarif"

View File

@@ -11,7 +11,7 @@ steps:
with:
output: "${{ runner.temp }}/results"
- name: Upload SARIF
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json
path: "${{ runner.temp }}/results/javascript.sarif"

View File

@@ -2,6 +2,7 @@ name: "Local CodeQL bundle"
description: "Tests using a CodeQL bundle from a local file rather than a URL"
versions: ["linked"]
installGo: true
installPython: true
steps:
- name: Fetch latest CodeQL bundle
run: |

View File

@@ -4,6 +4,7 @@ operatingSystems: ["macos", "ubuntu"]
env:
CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true
installGo: true
installPython: true
steps:
- name: Use Xcode 16
if: runner.os == 'macOS' && matrix.version != 'nightly-latest'

View File

@@ -3,6 +3,7 @@ description: "Checks that specifying packages using a combination of a config fi
versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs
installGo: true
installNode: true
installPython: true
steps:
- uses: ./../action/init
with:

View File

@@ -36,9 +36,10 @@ steps:
with:
output: "${{ runner.temp }}/results"
upload-database: false
post-processed-sarif-path: "${{ runner.temp }}/post-processed"
- name: Upload security SARIF
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: |
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
@@ -46,12 +47,20 @@ steps:
retention-days: 7
- name: Upload quality SARIF
if: contains(matrix.analysis-kinds, 'code-quality')
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: |
quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.quality.sarif.json
path: "${{ runner.temp }}/results/javascript.quality.sarif"
retention-days: 7
- name: Upload post-processed SARIF
uses: actions/upload-artifact@v5
with:
name: |
post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json
path: "${{ runner.temp }}/post-processed"
retention-days: 7
if-no-files-found: error
- name: Check quality query does not appear in security SARIF
if: contains(matrix.analysis-kinds, 'code-scanning')
uses: actions/github-script@v8

View File

@@ -6,6 +6,7 @@ versions:
- linked
- nightly-latest
installGo: true
installPython: true
steps:
- uses: ./../action/init
with:

View File

@@ -4,7 +4,7 @@ description: "Tests using RuboCop to analyze a multi-language repository and the
versions: ["default"]
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@0481980f17b760ef6bca5e8c55809102a0af1e5a # v1.263.0
uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
with:
ruby-version: 2.6
- name: Install Code Scanning integration

View File

@@ -6,6 +6,7 @@ versions:
- linked
- nightly-latest
installGo: true
installPython: true
steps:
- uses: ./../action/init
id: init

View File

@@ -1,26 +0,0 @@
name: "Upload-sarif: code quality endpoint"
description: "Checks that uploading SARIFs to the code quality endpoint works"
versions: ["default"]
installGo: true
steps:
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: csharp,java,javascript,python
analysis-kinds: code-quality
- name: Build code
run: ./build.sh
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
upload: never
- uses: ./../action/upload-sarif
id: upload-sarif
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
- name: "Check output from `upload-sarif` step"
if: '!(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)'
run: exit 1

View File

@@ -2,6 +2,7 @@ name: "Upload-sarif: 'ref' and 'sha' from inputs"
description: "Checks that specifying 'ref' and 'sha' as inputs works"
versions: ["default"]
installGo: true
installPython: true
steps:
- uses: ./../action/init
with:

View File

@@ -0,0 +1,82 @@
name: "Test different uses of `upload-sarif`"
description: "Checks that uploading SARIFs to the code quality endpoint works"
versions: ["default"]
analysisKinds: ["code-scanning", "code-quality", "code-scanning,code-quality"]
installGo: true
installPython: true
steps:
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
languages: csharp,java,javascript,python
analysis-kinds: ${{ matrix.analysis-kinds }}
- name: Build code
run: ./build.sh
# Generate some SARIF we can upload with the upload-sarif step
- uses: ./../action/analyze
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
upload: never
output: ${{ runner.temp }}/results
- name: |
Upload all SARIF files for `analysis-kinds: ${{ matrix.analysis-kinds }}`
uses: ./../action/upload-sarif
id: upload-sarif
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
sarif_file: ${{ runner.temp }}/results
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:all-files/
- name: "Fail for missing output from `upload-sarif` step for `code-scanning`"
if: "contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-scanning)"
run: exit 1
- name: "Fail for missing output from `upload-sarif` step for `code-quality`"
if: "contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-sarif.outputs.sarif-ids).code-quality)"
run: exit 1
- name: Upload single SARIF file for Code Scanning
uses: ./../action/upload-sarif
id: upload-single-sarif-code-scanning
if: "contains(matrix.analysis-kinds, 'code-scanning')"
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
sarif_file: ${{ runner.temp }}/results/javascript.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-scanning/
- name: "Fail for missing output from `upload-single-sarif-code-scanning` step"
if: "contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-sarif-code-scanning.outputs.sarif-ids).code-scanning)"
run: exit 1
- name: Upload single SARIF file for Code Quality
uses: ./../action/upload-sarif
id: upload-single-sarif-code-quality
if: "contains(matrix.analysis-kinds, 'code-quality')"
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
sarif_file: ${{ runner.temp }}/results/javascript.quality.sarif
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:single-code-quality/
- name: "Fail for missing output from `upload-single-sarif-code-quality` step"
if: "contains(matrix.analysis-kinds, 'code-quality') && !(fromJSON(steps.upload-single-sarif-code-quality.outputs.sarif-ids).code-quality)"
run: exit 1
- name: Change SARIF file extension
if: "contains(matrix.analysis-kinds, 'code-scanning')"
run: mv ${{ runner.temp }}/results/javascript.sarif ${{ runner.temp }}/results/javascript.sarif.json
- name: Upload single non-`.sarif` file
uses: ./../action/upload-sarif
id: upload-single-non-sarif
if: "contains(matrix.analysis-kinds, 'code-scanning')"
with:
ref: 'refs/heads/main'
sha: '5e235361806c361d4d3f8859e3c897658025a9a2'
sarif_file: ${{ runner.temp }}/results/javascript.sarif.json
category: |
${{ github.workflow }}:upload-sarif/analysis-kinds:${{ matrix.analysis-kinds }}/os:${{ matrix.os }}/version:${{ matrix.version }}/test:non-sarif/
- name: "Fail for missing output from `upload-single-non-sarif` step"
if: "contains(matrix.analysis-kinds, 'code-scanning') && !(fromJSON(steps.upload-single-non-sarif.outputs.sarif-ids).code-scanning)"
run: exit 1

View File

@@ -2,6 +2,7 @@ name: "Use a custom `checkout_path`"
description: "Checks that a custom `checkout_path` will find the proper commit_oid"
versions: ["linked"]
installGo: true
installPython: true
steps:
# This ensures we don't accidentally use the original checkout for any part of the test.
- name: Delete original checkout
@@ -37,28 +38,29 @@ steps:
- name: Verify SARIF after upload
run: |
PAYLOAD_FILE="$RUNNER_TEMP/payload-code-scanning.json"
EXPECTED_COMMIT_OID="474bbf07f9247ffe1856c6a0f94aeeb10e7afee6"
EXPECTED_REF="v1.1.0"
EXPECTED_CHECKOUT_URI_SUFFIX="/x/y/z/some-path/tests/multi-language-repo"
ACTUAL_COMMIT_OID="$(cat "$RUNNER_TEMP/payload.json" | jq -r .commit_oid)"
ACTUAL_REF="$(cat "$RUNNER_TEMP/payload.json" | jq -r .ref)"
ACTUAL_CHECKOUT_URI="$(cat "$RUNNER_TEMP/payload.json" | jq -r .checkout_uri)"
ACTUAL_COMMIT_OID="$(cat "$PAYLOAD_FILE" | jq -r .commit_oid)"
ACTUAL_REF="$(cat "$PAYLOAD_FILE" | jq -r .ref)"
ACTUAL_CHECKOUT_URI="$(cat "$PAYLOAD_FILE" | jq -r .checkout_uri)"
if [[ "$EXPECTED_COMMIT_OID" != "$ACTUAL_COMMIT_OID" ]]; then
echo "::error Invalid commit oid. Expected: $EXPECTED_COMMIT_OID Actual: $ACTUAL_COMMIT_OID"
echo "$RUNNER_TEMP/payload.json"
echo "$PAYLOAD_FILE"
exit 1
fi
if [[ "$EXPECTED_REF" != "$ACTUAL_REF" ]]; then
echo "::error Invalid ref. Expected: '$EXPECTED_REF' Actual: '$ACTUAL_REF'"
echo "$RUNNER_TEMP/payload.json"
echo "$PAYLOAD_FILE"
exit 1
fi
if [[ "$ACTUAL_CHECKOUT_URI" != *$EXPECTED_CHECKOUT_URI_SUFFIX ]]; then
echo "::error Invalid checkout URI suffix. Expected suffix: $EXPECTED_CHECKOUT_URI_SUFFIX Actual uri: $ACTUAL_CHECKOUT_URI"
echo "$RUNNER_TEMP/payload.json"
echo "$PAYLOAD_FILE"
exit 1
fi

View File

@@ -117,7 +117,7 @@ for file in sorted((this_dir / 'checks').glob('*.yml')):
steps.extend([
{
'name': 'Install Node.js',
'uses': 'actions/setup-node@v5',
'uses': 'actions/setup-node@v6',
'with': {
'node-version': '20.x',
'cache': 'npm',
@@ -184,6 +184,26 @@ for file in sorted((this_dir / 'checks').glob('*.yml')):
}
})
installPython = is_truthy(checkSpecification.get('installPython', ''))
if installPython:
basePythonVersionExpr = '3.13'
workflowInputs['python-version'] = {
'type': 'string',
'description': 'The version of Python to install',
'required': False,
'default': basePythonVersionExpr,
}
steps.append({
'name': 'Install Python',
'if': 'matrix.version != \'nightly-latest\'',
'uses': 'actions/setup-python@v6',
'with': {
'python-version': '${{ inputs.python-version || \'' + basePythonVersionExpr + '\' }}'
}
})
# If container initialisation steps are present in the check specification,
# make sure to execute them first.
if 'container' in checkSpecification and 'container-init-steps' in checkSpecification:

View File

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

View File

@@ -9,9 +9,15 @@ if [ "$GITHUB_ACTIONS" = "true" ]; then
fi
# Check if npm install is likely needed before proceeding
if [ ! -d node_modules ] || [ package-lock.json -nt node_modules/.package-lock.json ]; then
echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated..."
if [ ! -d node_modules ]; then
echo "Running 'npm install' because 'node_modules' directory is missing."
npm install
elif [ package.json -nt package-lock.json ]; then
echo "Running 'npm install' because 'package-lock.json' appears to be outdated."
npm install
elif [ package-lock.json -nt node_modules/.package-lock.json ]; then
echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated."
npm install
else
echo "Skipping 'npm install' because 'node_modules/.package-lock.json' appears to be up-to-date."
echo "Skipping 'npm install' because everything appears to be up-to-date."
fi

39
setup-codeql/action.yml Normal file
View File

@@ -0,0 +1,39 @@
name: 'CodeQL: Setup'
description: 'Installs the CodeQL CLI'
author: 'GitHub'
inputs:
tools:
description: >-
By default, the Action will use the recommended version of the CodeQL
Bundle to analyze your project. You can override this choice using this
input. One of:
- A local path to a CodeQL Bundle tarball, or
- The URL of a CodeQL Bundle tarball GitHub release asset, or
- A special value `linked` which uses the version of the CodeQL tools
that the Action has been bundled with.
- A special value `nightly` which uses the latest nightly version of the
CodeQL tools. Note that this is unstable and not recommended for
production use.
If not specified, the Action will check in several places until it finds
the CodeQL tools.
required: false
token:
description: GitHub token to use for authenticating with this instance of GitHub.
default: ${{ github.token }}
required: false
matrix:
default: ${{ toJson(matrix) }}
required: false
external-repository-token:
description: A token for fetching additional files from private repositories in the same GitHub instance that is running this action.
required: false
outputs:
codeql-path:
description: The path of the CodeQL binary that was installed.
codeql-version:
description: The version of the CodeQL binary that was installed.
runs:
using: node24
main: '../lib/setup-codeql-action.js'

View File

@@ -247,9 +247,14 @@ export function isSelfHostedRunner() {
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
}
/** Determines whether the workflow trigger is `dynamic`. */
export function isDynamicWorkflow(): boolean {
return getWorkflowEventName() === "dynamic";
}
/** Determines whether we are running in default setup. */
export function isDefaultSetup(): boolean {
return getWorkflowEventName() === "dynamic";
return isDynamicWorkflow();
}
export function prettyPrintInvocation(cmd: string, args: string[]): string {

View File

@@ -1,12 +1,19 @@
import test from "ava";
import * as sinon from "sinon";
import * as actionsUtil from "./actions-util";
import {
AnalysisKind,
getAnalysisKinds,
parseAnalysisKinds,
supportedAnalysisKinds,
} from "./analyses";
import { getRunnerLogger } from "./logging";
import { setupTests } from "./testing-utils";
import { ConfigurationError } from "./util";
setupTests(test);
test("All known analysis kinds can be parsed successfully", async (t) => {
for (const analysisKind of supportedAnalysisKinds) {
t.deepEqual(await parseAnalysisKinds(analysisKind), [analysisKind]);
@@ -34,3 +41,29 @@ test("Parsing analysis kinds requires at least one analysis kind", async (t) =>
instanceOf: ConfigurationError,
});
});
test("getAnalysisKinds - returns expected analysis kinds for `analysis-kinds` input", async (t) => {
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
requiredInputStub
.withArgs("analysis-kinds")
.returns("code-scanning,code-quality");
const result = await getAnalysisKinds(getRunnerLogger(true), true);
t.assert(result.includes(AnalysisKind.CodeScanning));
t.assert(result.includes(AnalysisKind.CodeQuality));
});
test("getAnalysisKinds - includes `code-quality` when deprecated `quality-queries` input is used", async (t) => {
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
requiredInputStub.withArgs("analysis-kinds").returns("code-scanning");
const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
optionalInputStub.withArgs("quality-queries").returns("code-quality");
const result = await getAnalysisKinds(getRunnerLogger(true), true);
t.assert(result.includes(AnalysisKind.CodeScanning));
t.assert(result.includes(AnalysisKind.CodeQuality));
});
test("getAnalysisKinds - throws if `analysis-kinds` input is invalid", async (t) => {
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
requiredInputStub.withArgs("analysis-kinds").returns("no-such-thing");
await t.throwsAsync(getAnalysisKinds(getRunnerLogger(true), true));
});

View File

@@ -1,4 +1,8 @@
import { fixCodeQualityCategory } from "./actions-util";
import {
fixCodeQualityCategory,
getOptionalInput,
getRequiredInput,
} from "./actions-util";
import { Logger } from "./logging";
import { ConfigurationError } from "./util";
@@ -41,6 +45,55 @@ export async function parseAnalysisKinds(
);
}
// Used to avoid re-parsing the input after we have done it once.
let cachedAnalysisKinds: AnalysisKind[] | undefined;
/**
* Initialises the analysis kinds for the analysis based on the `analysis-kinds` input.
* This function will also use the deprecated `quality-queries` input as an indicator to enable `code-quality`.
* If the `analysis-kinds` input cannot be parsed, a `ConfigurationError` is thrown.
*
* @param logger The logger to use.
* @param skipCache For testing, whether to ignore the cached values (default: false).
*
* @returns The array of enabled analysis kinds.
* @throws A `ConfigurationError` if the `analysis-kinds` input cannot be parsed.
*/
export async function getAnalysisKinds(
logger: Logger,
skipCache: boolean = false,
): Promise<AnalysisKind[]> {
if (!skipCache && cachedAnalysisKinds !== undefined) {
return cachedAnalysisKinds;
}
cachedAnalysisKinds = await parseAnalysisKinds(
getRequiredInput("analysis-kinds"),
);
// Warn that `quality-queries` is deprecated if there is an argument for it.
const qualityQueriesInput = getOptionalInput("quality-queries");
if (qualityQueriesInput !== undefined) {
logger.warning(
"The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. " +
"Use the `analysis-kinds` input to configure different analysis kinds instead.",
);
}
// For backwards compatibility, add Code Quality to the enabled analysis kinds
// if an input to `quality-queries` was specified. We should remove this once
// `quality-queries` is no longer used.
if (
!cachedAnalysisKinds.includes(AnalysisKind.CodeQuality) &&
qualityQueriesInput !== undefined
) {
cachedAnalysisKinds.push(AnalysisKind.CodeQuality);
}
return cachedAnalysisKinds;
}
/** The queries to use for Code Quality analyses. */
export const codeQualityQueries: string[] = ["code-quality"];

View File

@@ -24,6 +24,9 @@ setupTests(test);
// but the first test would fail.
test("analyze action with RAM & threads from environment variables", async (t) => {
// This test frequently times out on Windows with the default timeout, so we bump
// it a bit to 20s.
t.timeout(1000 * 20);
await util.withTmpDir(async (tmpDir) => {
process.env["GITHUB_SERVER_URL"] = util.GITHUB_DOTCOM_URL;
process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
@@ -75,7 +78,7 @@ test("analyze action with RAM & threads from environment variables", async (t) =
t.deepEqual(runFinalizeStub.firstCall.args[1], "--threads=-1");
t.deepEqual(runFinalizeStub.firstCall.args[2], "--ram=4992");
t.assert(runQueriesStub.calledOnce);
t.deepEqual(runQueriesStub.firstCall.args[3], "--threads=-1");
t.deepEqual(runQueriesStub.firstCall.args[2], "--threads=-1");
t.deepEqual(runQueriesStub.firstCall.args[1], "--ram=4992");
});
});

View File

@@ -24,6 +24,7 @@ setupTests(test);
// but the first test would fail.
test("analyze action with RAM & threads from action inputs", async (t) => {
t.timeout(1000 * 20);
await util.withTmpDir(async (tmpDir) => {
process.env["GITHUB_SERVER_URL"] = util.GITHUB_DOTCOM_URL;
process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository";
@@ -75,7 +76,7 @@ test("analyze action with RAM & threads from action inputs", async (t) => {
t.deepEqual(runFinalizeStub.firstCall.args[1], "--threads=-1");
t.deepEqual(runFinalizeStub.firstCall.args[2], "--ram=3012");
t.assert(runQueriesStub.calledOnce);
t.deepEqual(runQueriesStub.firstCall.args[3], "--threads=-1");
t.deepEqual(runQueriesStub.firstCall.args[2], "--threads=-1");
t.deepEqual(runQueriesStub.firstCall.args[1], "--ram=3012");
});
});

View File

@@ -52,6 +52,7 @@ import {
} from "./trap-caching";
import * as uploadLib from "./upload-lib";
import { UploadResult } from "./upload-lib";
import { postProcessAndUploadSarif } from "./upload-sarif";
import * as util from "./util";
interface AnalysisStatusReport
@@ -211,7 +212,9 @@ async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) {
async function run() {
const startedAt = new Date();
let uploadResult: UploadResult | undefined = undefined;
let uploadResults:
| Partial<Record<analyses.AnalysisKind, UploadResult>>
| undefined = undefined;
let runStats: QueriesStatusReport | undefined = undefined;
let config: Config | undefined = undefined;
let trapCacheCleanupTelemetry: TrapCacheCleanupStatusReport | undefined =
@@ -321,10 +324,16 @@ async function run() {
);
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
// Warn if the removed `add-snippets` input is used.
if (actionsUtil.getOptionalInput("add-snippets") !== undefined) {
logger.warning(
"The `add-snippets` input has been removed and no longer has any effect.",
);
}
runStats = await runQueries(
outputDir,
memory,
util.getAddSnippetsFlag(actionsUtil.getRequiredInput("add-snippets")),
threads,
diffRangePackDir,
actionsUtil.getOptionalInput("category"),
@@ -341,31 +350,67 @@ async function run() {
}
core.setOutput("db-locations", dbLocations);
core.setOutput("sarif-output", path.resolve(outputDir));
const uploadInput = actionsUtil.getOptionalInput("upload");
if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") {
if (isCodeScanningEnabled(config)) {
uploadResult = await uploadLib.uploadFiles(
outputDir,
actionsUtil.getRequiredInput("checkout_path"),
actionsUtil.getOptionalInput("category"),
features,
const uploadKind = actionsUtil.getUploadValue(
actionsUtil.getOptionalInput("upload"),
);
if (runStats) {
const checkoutPath = actionsUtil.getRequiredInput("checkout_path");
const category = actionsUtil.getOptionalInput("category");
if (await features.getValue(Feature.AnalyzeUseNewUpload)) {
uploadResults = await postProcessAndUploadSarif(
logger,
analyses.CodeScanning,
features,
uploadKind,
checkoutPath,
outputDir,
category,
actionsUtil.getOptionalInput("post-processed-sarif-path"),
);
core.setOutput("sarif-id", uploadResult.sarifID);
} else if (uploadKind === "always") {
uploadResults = {};
if (isCodeScanningEnabled(config)) {
uploadResults[analyses.AnalysisKind.CodeScanning] =
await uploadLib.uploadFiles(
outputDir,
checkoutPath,
category,
features,
logger,
analyses.CodeScanning,
);
}
if (isCodeQualityEnabled(config)) {
uploadResults[analyses.AnalysisKind.CodeQuality] =
await uploadLib.uploadFiles(
outputDir,
checkoutPath,
category,
features,
logger,
analyses.CodeQuality,
);
}
} else {
uploadResults = {};
logger.info("Not uploading results");
}
if (isCodeQualityEnabled(config)) {
const analysis = analyses.CodeQuality;
const qualityUploadResult = await uploadLib.uploadFiles(
outputDir,
actionsUtil.getRequiredInput("checkout_path"),
actionsUtil.getOptionalInput("category"),
features,
logger,
analysis,
// Set the SARIF id outputs only if we have results for them, to avoid
// having keys with empty values in the action output.
if (uploadResults[analyses.AnalysisKind.CodeScanning] !== undefined) {
core.setOutput(
"sarif-id",
uploadResults[analyses.AnalysisKind.CodeScanning].sarifID,
);
}
if (uploadResults[analyses.AnalysisKind.CodeQuality] !== undefined) {
core.setOutput(
"quality-sarif-id",
uploadResults[analyses.AnalysisKind.CodeQuality].sarifID,
);
core.setOutput("quality-sarif-id", qualityUploadResult.sarifID);
}
} else {
logger.info("Not uploading results");
@@ -408,12 +453,12 @@ async function run() {
if (util.isInTestMode()) {
logger.debug("In test mode. Waiting for processing is disabled.");
} else if (
uploadResult !== undefined &&
uploadResults?.[analyses.AnalysisKind.CodeScanning] !== undefined &&
actionsUtil.getRequiredInput("wait-for-processing") === "true"
) {
await uploadLib.waitForProcessing(
getRepositoryNwo(),
uploadResult.sarifID,
uploadResults[analyses.AnalysisKind.CodeScanning].sarifID,
getActionsLogger(),
);
}
@@ -450,13 +495,16 @@ async function run() {
return;
}
if (runStats && uploadResult) {
if (
runStats !== undefined &&
uploadResults?.[analyses.AnalysisKind.CodeScanning] !== undefined
) {
await sendStatusReport(
startedAt,
config,
{
...runStats,
...uploadResult.statusReport,
...uploadResults[analyses.AnalysisKind.CodeScanning].statusReport,
},
undefined,
trapCacheUploadTime,
@@ -466,7 +514,7 @@ async function run() {
dependencyCacheResults,
logger,
);
} else if (runStats) {
} else if (runStats !== undefined) {
await sendStatusReport(
startedAt,
config,

View File

@@ -7,11 +7,11 @@ import * as sinon from "sinon";
import * as actionsUtil from "./actions-util";
import { CodeQuality, CodeScanning } from "./analyses";
import {
exportedForTesting,
runQueries,
defaultSuites,
resolveQuerySuiteAlias,
addSarifExtension,
diffRangeExtensionPackContents,
} from "./analyze";
import { createStubCodeQL } from "./codeql";
import { Feature } from "./feature-flags";
@@ -39,7 +39,6 @@ test("status report fields", async (t) => {
setupActionsVars(tmpDir, tmpDir);
const memoryFlag = "";
const addSnippetsFlag = "";
const threadsFlag = "";
sinon.stub(uploadLib, "validateSarifFileSchema");
@@ -105,7 +104,6 @@ test("status report fields", async (t) => {
const statusReport = await runQueries(
tmpDir,
memoryFlag,
addSnippetsFlag,
threadsFlag,
undefined,
undefined,
@@ -131,204 +129,6 @@ test("status report fields", async (t) => {
});
});
function runGetDiffRanges(changes: number, patch: string[] | undefined): any {
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("checkout_path")
.returns("/checkout/path");
return exportedForTesting.getDiffRanges(
{
filename: "test.txt",
changes,
patch: patch?.join("\n"),
},
getRunnerLogger(true),
);
}
test("getDiffRanges: file unchanged", async (t) => {
const diffRanges = runGetDiffRanges(0, undefined);
t.deepEqual(diffRanges, []);
});
test("getDiffRanges: file diff too large", async (t) => {
const diffRanges = runGetDiffRanges(1000000, undefined);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 0,
endLine: 0,
},
]);
});
test("getDiffRanges: diff thunk with single addition range", async (t) => {
const diffRanges = runGetDiffRanges(2, [
"@@ -30,6 +50,8 @@",
" a",
" b",
" c",
"+1",
"+2",
" d",
" e",
" f",
]);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 53,
endLine: 54,
},
]);
});
test("getDiffRanges: diff thunk with single deletion range", async (t) => {
const diffRanges = runGetDiffRanges(2, [
"@@ -30,8 +50,6 @@",
" a",
" b",
" c",
"-1",
"-2",
" d",
" e",
" f",
]);
t.deepEqual(diffRanges, []);
});
test("getDiffRanges: diff thunk with single update range", async (t) => {
const diffRanges = runGetDiffRanges(2, [
"@@ -30,7 +50,7 @@",
" a",
" b",
" c",
"-1",
"+2",
" d",
" e",
" f",
]);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 53,
endLine: 53,
},
]);
});
test("getDiffRanges: diff thunk with addition ranges", async (t) => {
const diffRanges = runGetDiffRanges(2, [
"@@ -30,7 +50,9 @@",
" a",
" b",
" c",
"+1",
" c",
"+2",
" d",
" e",
" f",
]);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 53,
endLine: 53,
},
{
path: "/checkout/path/test.txt",
startLine: 55,
endLine: 55,
},
]);
});
test("getDiffRanges: diff thunk with mixed ranges", async (t) => {
const diffRanges = runGetDiffRanges(2, [
"@@ -30,7 +50,7 @@",
" a",
" b",
" c",
"-1",
" d",
"-2",
"+3",
" e",
" f",
"+4",
"+5",
" g",
" h",
" i",
]);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 54,
endLine: 54,
},
{
path: "/checkout/path/test.txt",
startLine: 57,
endLine: 58,
},
]);
});
test("getDiffRanges: multiple diff thunks", async (t) => {
const diffRanges = runGetDiffRanges(2, [
"@@ -30,6 +50,8 @@",
" a",
" b",
" c",
"+1",
"+2",
" d",
" e",
" f",
"@@ -130,6 +150,8 @@",
" a",
" b",
" c",
"+1",
"+2",
" d",
" e",
" f",
]);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 53,
endLine: 54,
},
{
path: "/checkout/path/test.txt",
startLine: 153,
endLine: 154,
},
]);
});
test("getDiffRanges: no diff context lines", async (t) => {
const diffRanges = runGetDiffRanges(2, ["@@ -30 +50,2 @@", "+1", "+2"]);
t.deepEqual(diffRanges, [
{
path: "/checkout/path/test.txt",
startLine: 50,
endLine: 51,
},
]);
});
test("getDiffRanges: malformed thunk header", async (t) => {
const diffRanges = runGetDiffRanges(2, ["@@ 30 +50,2 @@", "+1", "+2"]);
t.deepEqual(diffRanges, undefined);
});
test("resolveQuerySuiteAlias", (t) => {
// default query suite names should resolve to something language-specific ending in `.qls`.
for (const suite of defaultSuites) {
@@ -360,3 +160,23 @@ test("addSarifExtension", (t) => {
);
}
});
test("diffRangeExtensionPackContents", (t) => {
sinon
.stub(actionsUtil, "getRequiredInput")
.withArgs("checkout_path")
.returns("/checkout/path");
const output = diffRangeExtensionPackContents([
{
path: "main.js",
startLine: 10,
endLine: 20,
},
]);
const expected = fs.readFileSync(
`${__dirname}/../src/testdata/pr-diff-range.yml`,
"utf8",
);
t.deepEqual(output, expected);
});

View File

@@ -3,16 +3,14 @@ import * as path from "path";
import { performance } from "perf_hooks";
import * as io from "@actions/io";
import * as del from "del";
import * as yaml from "js-yaml";
import {
getRequiredInput,
getTemporaryDirectory,
getRequiredInput,
PullRequestBranches,
} from "./actions-util";
import * as analyses from "./analyses";
import { getApiClient } from "./api-client";
import { setupCppAutobuild } from "./autobuild";
import { type CodeQL } from "./codeql";
import * as configUtils from "./config-utils";
@@ -21,13 +19,13 @@ import { addDiagnostic, makeDiagnostic } from "./diagnostics";
import {
DiffThunkRange,
writeDiffRangesJsonFile,
getPullRequestEditedDiffRanges,
} from "./diff-informed-analysis-utils";
import { EnvVar } from "./environment";
import { FeatureEnablement, Feature } from "./feature-flags";
import { KnownLanguage, Language } from "./languages";
import { Logger, withGroupAsync } from "./logging";
import { OverlayDatabaseMode } from "./overlay-database-utils";
import { getRepositoryNwoFromEnv } from "./repository";
import { DatabaseCreationTimings, EventReport } from "./status-report";
import { endTracingForCluster } from "./tracer-config";
import * as util from "./util";
@@ -44,89 +42,26 @@ export class CodeQLAnalysisError extends Error {
}
}
export interface QueriesStatusReport {
/**
* Time taken in ms to run queries for actions (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_actions_duration_ms?: number;
/**
* Time taken in ms to run queries for cpp (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_cpp_duration_ms?: number;
/**
* Time taken in ms to run queries for csharp (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_csharp_duration_ms?: number;
/**
* Time taken in ms to run queries for go (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_go_duration_ms?: number;
/**
* Time taken in ms to run queries for java (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_java_duration_ms?: number;
/**
* Time taken in ms to run queries for javascript (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_javascript_duration_ms?: number;
/**
* Time taken in ms to run queries for python (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_python_duration_ms?: number;
/**
* Time taken in ms to run queries for ruby (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_ruby_duration_ms?: number;
/** Time taken in ms to run queries for swift (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
analyze_builtin_queries_swift_duration_ms?: number;
type KnownLanguageKey = keyof typeof KnownLanguage;
/** Time taken in ms to interpret results for actions (or undefined if this language was not analyzed). */
interpret_results_actions_duration_ms?: number;
/** Time taken in ms to interpret results for cpp (or undefined if this language was not analyzed). */
interpret_results_cpp_duration_ms?: number;
/** Time taken in ms to interpret results for csharp (or undefined if this language was not analyzed). */
interpret_results_csharp_duration_ms?: number;
/** Time taken in ms to interpret results for go (or undefined if this language was not analyzed). */
interpret_results_go_duration_ms?: number;
/** Time taken in ms to interpret results for java (or undefined if this language was not analyzed). */
interpret_results_java_duration_ms?: number;
/** Time taken in ms to interpret results for javascript (or undefined if this language was not analyzed). */
interpret_results_javascript_duration_ms?: number;
/** Time taken in ms to interpret results for python (or undefined if this language was not analyzed). */
interpret_results_python_duration_ms?: number;
/** Time taken in ms to interpret results for ruby (or undefined if this language was not analyzed). */
interpret_results_ruby_duration_ms?: number;
/** Time taken in ms to interpret results for swift (or undefined if this language was not analyzed). */
interpret_results_swift_duration_ms?: number;
type RunQueriesDurationStatusReport = {
/**
* Time taken in ms to run queries for the language (or undefined if this language was not analyzed).
*
* The "builtin" designation is now outdated with the move to CLI config parsing: this is the time
* taken to run _all_ the queries.
*/
[L in KnownLanguageKey as `analyze_builtin_queries_${L}_duration_ms`]?: number;
};
type InterpretResultsDurationStatusReport = {
/** Time taken in ms to interpret results for the language (or undefined if this language was not analyzed). */
[L in KnownLanguageKey as `interpret_results_${L}_duration_ms`]?: number;
};
export interface QueriesStatusReport
extends RunQueriesDurationStatusReport,
InterpretResultsDurationStatusReport {
/**
* Whether the analysis is diff-informed (in the sense that the action generates a diff-range data
* extension for the analysis, regardless of whether the data extension is actually used by queries).
@@ -313,183 +248,43 @@ export async function setupDiffInformedQueryRun(
);
}
/**
* Return the file line ranges that were added or modified in the pull request.
*
* @param branches The base and head branches of the pull request.
* @param logger
* @returns An array of tuples, where each tuple contains the absolute path of a
* file, the start line and the end line (both 1-based and inclusive) of an
* added or modified range in that file. Returns `undefined` if the action was
* not triggered by a pull request or if there was an error.
*/
async function getPullRequestEditedDiffRanges(
branches: PullRequestBranches,
logger: Logger,
): Promise<DiffThunkRange[] | undefined> {
const fileDiffs = await getFileDiffsWithBasehead(branches, logger);
if (fileDiffs === undefined) {
return undefined;
}
if (fileDiffs.length >= 300) {
// The "compare two commits" API returns a maximum of 300 changed files. If
// we see that many changed files, it is possible that there could be more,
// with the rest being truncated. In this case, we should not attempt to
// compute the diff ranges, as the result would be incomplete.
logger.warning(
`Cannot retrieve the full diff because there are too many ` +
`(${fileDiffs.length}) changed files in the pull request.`,
);
return undefined;
}
const results: DiffThunkRange[] = [];
for (const filediff of fileDiffs) {
const diffRanges = getDiffRanges(filediff, logger);
if (diffRanges === undefined) {
return undefined;
}
results.push(...diffRanges);
}
return results;
}
export function diffRangeExtensionPackContents(
ranges: DiffThunkRange[],
): string {
const header = `
extensions:
- addsTo:
pack: codeql/util
extensible: restrictAlertsTo
checkPresence: false
data:
`;
/**
* This interface is an abbreviated version of the file diff object returned by
* the GitHub API.
*/
interface FileDiff {
filename: string;
changes: number;
// A patch may be absent if the file is binary, if the file diff is too large,
// or if the file is unchanged.
patch?: string | undefined;
}
let data = ranges
.map((range) => {
// Diff-informed queries expect the file path to be absolute. CodeQL always
// uses forward slashes as the path separator, so on Windows we need to
// replace any backslashes with forward slashes.
const filename = path
.join(getRequiredInput("checkout_path"), range.path)
.replaceAll(path.sep, "/");
async function getFileDiffsWithBasehead(
branches: PullRequestBranches,
logger: Logger,
): Promise<FileDiff[] | undefined> {
// Check CODE_SCANNING_REPOSITORY first. If it is empty or not set, fall back
// to GITHUB_REPOSITORY.
const repositoryNwo = getRepositoryNwoFromEnv(
"CODE_SCANNING_REPOSITORY",
"GITHUB_REPOSITORY",
);
const basehead = `${branches.base}...${branches.head}`;
try {
const response = await getApiClient().rest.repos.compareCommitsWithBasehead(
{
owner: repositoryNwo.owner,
repo: repositoryNwo.repo,
basehead,
per_page: 1,
},
);
logger.debug(
`Response from compareCommitsWithBasehead(${basehead}):` +
`\n${JSON.stringify(response, null, 2)}`,
);
return response.data.files;
} catch (error: any) {
if (error.status) {
logger.warning(`Error retrieving diff ${basehead}: ${error.message}`);
logger.debug(
`Error running compareCommitsWithBasehead(${basehead}):` +
`\nRequest: ${JSON.stringify(error.request, null, 2)}` +
`\nError Response: ${JSON.stringify(error.response, null, 2)}`,
// Using yaml.dump() with `forceQuotes: true` ensures that all special
// characters are escaped, and that the path is always rendered as a
// quoted string on a single line.
return (
` - [${yaml.dump(filename, { forceQuotes: true }).trim()}, ` +
`${range.startLine}, ${range.endLine}]\n`
);
return undefined;
} else {
throw error;
}
}
}
function getDiffRanges(
fileDiff: FileDiff,
logger: Logger,
): DiffThunkRange[] | undefined {
// Diff-informed queries expect the file path to be absolute. CodeQL always
// uses forward slashes as the path separator, so on Windows we need to
// replace any backslashes with forward slashes.
const filename = path
.join(getRequiredInput("checkout_path"), fileDiff.filename)
.replaceAll(path.sep, "/");
if (fileDiff.patch === undefined) {
if (fileDiff.changes === 0) {
// There are situations where a changed file legitimately has no diff.
// For example, the file may be a binary file, or that the file may have
// been renamed with no changes to its contents. In these cases, the
// file would be reported as having 0 changes, and we can return an empty
// array to indicate no diff range in this file.
return [];
}
// If a file is reported to have nonzero changes but no patch, that may be
// due to the file diff being too large. In this case, we should fall back
// to a special diff range that covers the entire file.
return [
{
path: filename,
startLine: 0,
endLine: 0,
},
];
})
.join("");
if (!data) {
// Ensure that the data extension is not empty, so that a pull request with
// no edited lines would exclude (instead of accepting) all alerts.
data = ' - ["", 0, 0]\n';
}
// The 1-based file line number of the current line
let currentLine = 0;
// The 1-based file line number that starts the current range of added lines
let additionRangeStartLine: number | undefined = undefined;
const diffRanges: DiffThunkRange[] = [];
const diffLines = fileDiff.patch.split("\n");
// Adding a fake context line at the end ensures that the following loop will
// always terminate the last range of added lines.
diffLines.push(" ");
for (const diffLine of diffLines) {
if (diffLine.startsWith("-")) {
// Ignore deletions completely -- we do not even want to consider them when
// calculating consecutive ranges of added lines.
continue;
}
if (diffLine.startsWith("+")) {
if (additionRangeStartLine === undefined) {
additionRangeStartLine = currentLine;
}
currentLine++;
continue;
}
if (additionRangeStartLine !== undefined) {
// Any line that does not start with a "+" or "-" terminates the current
// range of added lines.
diffRanges.push({
path: filename,
startLine: additionRangeStartLine,
endLine: currentLine - 1,
});
additionRangeStartLine = undefined;
}
if (diffLine.startsWith("@@ ")) {
// A new hunk header line resets the current line number.
const match = diffLine.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/);
if (match === null) {
logger.warning(
`Cannot parse diff hunk header for ${fileDiff.filename}: ${diffLine}`,
);
return undefined;
}
currentLine = parseInt(match[1], 10);
continue;
}
if (diffLine.startsWith(" ")) {
// An unchanged context line advances the current line number.
currentLine++;
continue;
}
}
return diffRanges;
return header + data;
}
/**
@@ -540,32 +335,7 @@ dataExtensions:
`,
);
const header = `
extensions:
- addsTo:
pack: codeql/util
extensible: restrictAlertsTo
checkPresence: false
data:
`;
let data = ranges
.map(
(range) =>
// Using yaml.dump() with `forceQuotes: true` ensures that all special
// characters are escaped, and that the path is always rendered as a
// quoted string on a single line.
` - [${yaml.dump(range.path, { forceQuotes: true }).trim()}, ` +
`${range.startLine}, ${range.endLine}]\n`,
)
.join("");
if (!data) {
// Ensure that the data extension is not empty, so that a pull request with
// no edited lines would exclude (instead of accepting) all alerts.
data = ' - ["", 0, 0]\n';
}
const extensionContents = header + data;
const extensionContents = diffRangeExtensionPackContents(ranges);
const extensionFilePath = path.join(diffRangeDir, "pr-diff-range.yml");
fs.writeFileSync(extensionFilePath, extensionContents);
logger.debug(
@@ -621,7 +391,6 @@ export function addSarifExtension(
export async function runQueries(
sarifFolder: string,
memoryFlag: string,
addSnippetsFlag: string,
threadsFlag: string,
diffRangePackDir: string | undefined,
automationDetailsId: string | undefined,
@@ -811,7 +580,6 @@ export async function runQueries(
databasePath,
queries,
sarifFile,
addSnippetsFlag,
threadsFlag,
enableDebugLogging ? "-vv" : "-v",
sarifRunPropertyFlag,
@@ -855,7 +623,7 @@ export async function runFinalize(
logger: Logger,
): Promise<DatabaseCreationTimings> {
try {
await del.deleteAsync(outputDir, { force: true });
await fs.promises.rm(outputDir, { force: true, recursive: true });
} catch (error: any) {
if (error?.code !== "ENOENT") {
throw error;
@@ -922,7 +690,3 @@ export async function warnIfGoInstalledAfterInit(
}
}
}
export const exportedForTesting = {
getDiffRanges,
};

View File

@@ -169,4 +169,32 @@ test("wrapApiConfigurationError correctly wraps specific configuration errors",
res,
new util.ConfigurationError("Resource not accessible by integration"),
);
// Enablement errors.
const enablementErrorMessages = [
"Code Security must be enabled for this repository to use code scanning",
"Advanced Security must be enabled for this repository to use code scanning",
"Code Scanning is not enabled for this repository. Please enable code scanning in the repository settings.",
];
const transforms = [
(msg: string) => msg,
(msg: string) => msg.toLowerCase(),
(msg: string) => msg.toLocaleUpperCase(),
];
for (const enablementErrorMessage of enablementErrorMessages) {
for (const transform of transforms) {
const enablementError = new util.HTTPError(
transform(enablementErrorMessage),
403,
);
res = api.wrapApiConfigurationError(enablementError);
t.deepEqual(
res,
new util.ConfigurationError(
api.getFeatureEnablementError(enablementError.message),
),
);
}
}
});

View File

@@ -1,18 +1,17 @@
import * as core from "@actions/core";
import * as githubUtils from "@actions/github/lib/utils";
import * as retry from "@octokit/plugin-retry";
import consoleLogLevel from "console-log-level";
import { getActionVersion, getRequiredInput } from "./actions-util";
import { Logger } from "./logging";
import { getRepositoryNwo, RepositoryNwo } from "./repository";
import {
asHTTPError,
ConfigurationError,
getRequiredEnvParam,
GITHUB_DOTCOM_URL,
GitHubVariant,
GitHubVersion,
isHTTPError,
parseGitHubUrl,
parseMatrixInput,
} from "./util";
@@ -50,7 +49,12 @@ function createApiClientWithDetails(
githubUtils.getOctokitOptions(auth, {
baseUrl: apiDetails.apiURL,
userAgent: `CodeQL-Action/${getActionVersion()}`,
log: consoleLogLevel({ level: "debug" }),
log: {
debug: core.debug,
info: core.info,
warn: core.warning,
error: core.error,
},
}),
);
}
@@ -279,23 +283,49 @@ export async function getRepositoryProperties(repositoryNwo: RepositoryNwo) {
});
}
function isEnablementError(msg: string) {
return [
/Code Security must be enabled/i,
/Advanced Security must be enabled/i,
/Code Scanning is not enabled/i,
].some((pattern) => pattern.test(msg));
}
// TODO: Move to `error-messages.ts` after refactoring import order to avoid cycle
// since `error-messages.ts` currently depends on this file.
export function getFeatureEnablementError(message: string): string {
return `Please verify that the necessary features are enabled: ${message}`;
}
export function wrapApiConfigurationError(e: unknown) {
if (isHTTPError(e)) {
const httpError = asHTTPError(e);
if (httpError !== undefined) {
if (
e.message.includes("API rate limit exceeded for installation") ||
e.message.includes("commit not found") ||
e.message.includes("Resource not accessible by integration") ||
/ref .* not found in this repository/.test(e.message)
[
/API rate limit exceeded/,
/commit not found/,
/Resource not accessible by integration/,
/ref .* not found in this repository/,
].some((pattern) => pattern.test(httpError.message))
) {
return new ConfigurationError(e.message);
} else if (
e.message.includes("Bad credentials") ||
e.message.includes("Not Found")
return new ConfigurationError(httpError.message);
}
if (
httpError.message.includes("Bad credentials") ||
httpError.message.includes("Not Found")
) {
return new ConfigurationError(
"Please check that your token is valid and has the required permissions: contents: read, security-events: write",
);
}
if (httpError.status === 403 && isEnablementError(httpError.message)) {
return new ConfigurationError(
getFeatureEnablementError(httpError.message),
);
}
if (httpError.status === 429) {
return new ConfigurationError("API rate limit exceeded");
}
}
return e;
}

View File

@@ -52,11 +52,11 @@ export async function determineAutobuildLanguages(
* For example, consider a user with the following workflow file:
*
* ```yml
* - uses: github/codeql-action/init@v3
* - uses: github/codeql-action/init@v4
* with:
* languages: go, java
* - uses: github/codeql-action/autobuild@v3
* - uses: github/codeql-action/analyze@v3
* - uses: github/codeql-action/autobuild@v4
* - uses: github/codeql-action/analyze@v4
* ```
*
* - With Go extraction disabled, we will run the Java autobuilder in the

View File

@@ -310,6 +310,20 @@ test("wrapCliConfigurationError - pack cannot be found", (t) => {
t.true(wrappedError instanceof ConfigurationError);
});
test("wrapCliConfigurationError - unknown query file", (t) => {
const commandError = new CommandInvocationError(
"codeql",
["database", "init"],
2,
"my-query-file is not a .ql file, .qls file, a directory, or a query pack specification. See the logs for more details.",
);
const cliError = new CliError(commandError);
const wrappedError = wrapCliConfigurationError(cliError);
t.true(wrappedError instanceof ConfigurationError);
});
test("wrapCliConfigurationError - pack missing auth", (t) => {
const commandError = new CommandInvocationError(
"codeql",

Some files were not shown because too many files have changed in this diff Show More