Compare commits

...
Author SHA1 Message Date
Michael B. Gale 59eef11129 Merge pull request #4369 from github/mbg/deps/2dec26
Update `ava` to `7.0.0` and update some transitive dependencies
2026-12-02 14:27:31 +00:00
Michael B. Gale 850ee97c37 Update ava to ^7.0.0 2026-12-02 14:14:55 +00:00
Michael B. Gale d4e321dbb9 Merge pull request #4368 from github/dependabot/npm_and_yarn/node-forge-1.4.4
Bump node-forge from 1.4.3 to 1.4.4
2026-12-02 12:58:02 +00:00
Michael B. Gale c072164c77 Merge branch 'main' into dependabot/npm_and_yarn/node-forge-1.4.4 2026-12-02 12:45:53 +00:00
Michael B. Gale b325c8f679 Merge pull request #4355 from github/dependabot/npm_and_yarn/npm-minor-7b67c78221
Bump the npm-minor group across 1 directory with 3 updates
2026-12-02 12:35:52 +00:00
github-actions[bot] 3a94bf46da Rebuild 2026-12-02 12:21:13 +00:00
dependabot[bot] ce127d35aa Bump node-forge from 1.4.3 to 1.4.4
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.4.3 to 1.4.4.
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.4.3...v1.4.4)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-version: 1.4.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-12-02 12:18:07 +00:00
Michael B. Gale 6d2038c23d Merge pull request #4359 from github/update-supported-enterprise-server-versions
Update supported GitHub Enterprise Server versions
2026-12-02 12:08:43 +00:00
Michael B. Gale b36689e70c Merge branch 'main' into dependabot/npm_and_yarn/npm-minor-7b67c78221 2026-12-02 11:50:14 +00:00
Michael B. Gale 3390e9dd7f Merge pull request #4356 from github/dependabot/github_actions/dot-github/workflows/actions-minor-11a96e39ce
Bump the actions-minor group across 1 directory with 4 updates
2026-12-02 11:49:17 +00:00
Henry Mercer c60d3bc058 Merge pull request #4367 from github/copilot/task-9919-259445878-e6cc8279-2a09-562a-b5f2-221a6efc22fa
Clarify runner-image exclusions
2026-12-02 10:31:59 +00:00
copilot-swe-agent[bot] efefe66b56 Clarify runner image exclusions 2026-12-01 16:35:15 +00:00
Henry Mercer 394261f58c Merge pull request #4345 from github/henrymercer/cancelled-runs-reporting
Report cancelled jobs with a separate job status in `init-post`
2026-11-30 14:05:17 +00:00
github-actions[bot] 0aa26b21cc Update supported GitHub Enterprise Server versions 2026-11-27 00:17:22 +00:00
github-actions[bot] c87aca8010 Rebuild 2026-11-25 17:59:05 +00:00
dependabot[bot] 9b30dda55f Bump the actions-minor group across 1 directory with 4 updates
Bumps the actions-minor group with 4 updates in the /.github/workflows directory: [actions/setup-dotnet](https://github.com/actions/setup-dotnet), [actions/setup-go](https://github.com/actions/setup-go), [actions/setup-java](https://github.com/actions/setup-java) and [actions/create-github-app-token](https://github.com/actions/create-github-app-token).


Updates `actions/setup-dotnet` from 6.0.0 to 6.1.0
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/a98b56852c35b8e3190ac28c8c2271da59106c68...0f4a354dd5547a28c70b7853dbd95d5b67886e73)

Updates `actions/setup-go` from 7.0.0 to 7.1.0
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/b7ad1dad31e06c5925ef5d2fc7ad053ef454303e...d8cbb8045d7f43706b9177cceb36c1f91a6644d5)

Updates `actions/setup-java` from 6.1.0 to 6.3.0
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/b843ebf9b913146b38da2eaa7aeddf76074ae1ad...d1374f8ac74474200d16ef8ecee22c7ae7a51880)

Updates `actions/create-github-app-token` from 3.3.0 to 3.4.0
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/create-github-app-token/compare/64ab729a6294000f5aa4a4bc0b73d1f32bc45510...f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: 6.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
- dependency-name: actions/setup-go
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
- dependency-name: actions/setup-java
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
- dependency-name: actions/create-github-app-token
  dependency-version: 3.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-25 17:55:52 +00:00
dependabot[bot] e624ebc48d Bump the npm-minor group across 1 directory with 3 updates
Bumps the npm-minor group with 3 updates in the / directory: [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc), [prettier](https://github.com/prettier/prettier) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint).


Updates `eslint-plugin-jsdoc` from 65.4.5 to 65.4.12
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v65.4.5...v65.4.12)

Updates `prettier` from 3.10.0 to 3.10.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.10.0...3.10.1)

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

---
updated-dependencies:
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 65.4.12
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: prettier
  dependency-version: 3.10.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: typescript-eslint
  dependency-version: 8.73.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-25 17:54:53 +00:00
Sam Robson 776237d428 Merge pull request #4349 from github/mergeback/v4.39.5-to-main-915412ff
Mergeback v4.39.5 refs/heads/releases/v4 into main
2026-11-24 15:18:32 +00:00
github-actions[bot] 743c02edee Rebuild 2026-11-24 14:58:39 +00:00
github-actions[bot] c27036f19d Update changelog and version after v4.39.5 2026-11-24 14:58:25 +00:00
Sam Robson 915412ff23 Merge pull request #4348 from github/update-v4.39.5-bed9c837c
Merge main into releases/v4
2026-11-24 14:56:45 +00:00
github-actions[bot] 35d990cd3b Update changelog for v4.39.5 2026-11-24 14:37:31 +00:00
Henry Mercer bed9c837cf Merge pull request #4346 from github/henrymercer/rename-to-overlay-analysis
Rename improved incremental analysis to overlay analysis
2026-11-24 12:25:45 +00:00
Henry Mercer 1f73992007 Merge pull request #4332 from github/henrymercer/codeql-action-bumps
Update the `minimatch` copies used by `archiver` and `eslint-plugin-import-x` to v11
2026-11-24 10:49:45 +00:00
Henry Mercer becf94ae7b Merge pull request #4344 from github/henrymercer/deflake-workflow-list
Generate the Deflake workflow list
2026-11-24 10:49:37 +00:00
Sam Robson 5d7d6cdfdb Merge pull request #4347 from github/update-bundle/codeql-bundle-v2.27.6
Update default bundle to 2.27.6
2026-11-24 10:32:01 +00:00
github-actions[bot] 0006d1f62f Add changenote 2026-11-24 09:59:57 +00:00
github-actions[bot] ca37df17a9 Update default bundle to codeql-bundle-v2.27.6 2026-11-24 09:59:50 +00:00
Henry MercerandCopilot App 7f3a2f5c7f Rename improved incremental analysis to overlay analysis
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-23 20:22:02 +00:00
Henry MercerandCopilot App b69d569f2c Report cancelled jobs with a separate job status in init-post
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-23 19:55:31 +00:00
Henry MercerandCopilot App 73d9b6db16 Generate the Deflake workflow list in pr-checks/sync.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-23 17:32:55 +00:00
Henry MercerandCopilot App 9ee158cbfd Update the Deflake workflow list to match the current PR checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-23 17:32:55 +00:00
Sam Robson 38112626f9 Merge pull request #4337 from github/mergeback/v4.39.4-to-main-1bd86f2f
Mergeback v4.39.4 refs/heads/releases/v4 into main
2026-11-20 10:25:22 +00:00
github-actions[bot] 4514a37f69 Rebuild 2026-11-20 10:06:28 +00:00
github-actions[bot] 633626518b Update changelog and version after v4.39.4 2026-11-20 10:06:19 +00:00
Sam Robson 1bd86f2fdb Merge pull request #4336 from github/update-v4.39.4-e9c4b4b15
Merge main into releases/v4
2026-11-20 10:05:00 +00:00
github-actions[bot] 4302074c68 Update changelog for v4.39.4 2026-11-20 09:36:41 +00:00
Sam Robson e9c4b4b153 Merge pull request #4333 from github/update-bundle/codeql-bundle-v2.27.5
Update default bundle to 2.27.5
2026-11-19 15:21:32 +00:00
github-actions[bot] ff59388e72 Add changenote 2026-11-19 14:52:46 +00:00
github-actions[bot] 5f85401d6e Update default bundle to codeql-bundle-v2.27.5 2026-11-19 14:52:39 +00:00
Henry Mercer 55aa1d2903 Merge pull request #4331 from github/henrymercer/exclude-post-pr-comments-check
Exclude `Post PR comments` from required checks
2026-11-19 13:44:46 +00:00
github-actions[bot] fa7acb99cd Rebuild 2026-11-19 13:21:30 +00:00
Henry MercerandCopilot App a27b4d64b7 Update minimatch to 11.0.8 where existing ranges allow
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-19 13:19:15 +00:00
Henry MercerandCopilot App 3fd9439bde Override archiver's readdir-glob to v4 to pick up minimatch v11
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-19 13:18:50 +00:00
Henry Mercer f8c39e2839 Merge pull request #4328 from github/dependabot/npm_and_yarn/fast-xml-parser-5.12.1
Bump fast-xml-parser from 5.7.1 to 5.12.1
2026-11-19 12:39:33 +00:00
Henry Mercer 04744453ff Merge pull request #4329 from github/dependabot/npm_and_yarn/npm-minor-04c9f5c560
Bump the npm-minor group across 1 directory with 9 updates
2026-11-19 12:39:10 +00:00
Henry Mercer da2d3808b4 Merge branch 'main' into dependabot/npm_and_yarn/fast-xml-parser-5.12.1 2026-11-19 12:27:02 +00:00
Henry Mercer 80c8b99423 Merge branch 'main' into dependabot/npm_and_yarn/npm-minor-04c9f5c560 2026-11-19 12:26:59 +00:00
Henry MercerandCopilot App 79d1def5b0 Exclude renamed Post PR comments job from required checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-19 11:06:47 +00:00
Henry Mercer b4de9cd566 Merge pull request #4313 from github/henrymercer/runner-image-coverage
Test the runner images in a dedicated `runner-images` PR check
2026-11-19 10:59:32 +00:00
Henry Mercer 08643f82a0 Merge branch 'main' into henrymercer/runner-image-coverage 2026-11-19 10:41:47 +00:00
github-actions[bot] c0775e22bf Rebuild 2026-11-18 17:58:21 +00:00
dependabot[bot] 6903896239 Bump the npm-minor group across 1 directory with 9 updates
Bumps the npm-minor group with 9 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [follow-redirects](https://github.com/follow-redirects/follow-redirects) | `1.16.1` | `1.16.3` |
| [node-forge](https://github.com/digitalbazaar/forge) | `1.4.1` | `1.4.3` |
| [semver](https://github.com/npm/node-semver) | `7.8.5` | `7.8.6` |
| [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) | `22.0.1` | `22.0.2` |
| [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) | `4.17.1` | `4.18.1` |
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | `65.4.0` | `65.4.5` |
| [globals](https://github.com/sindresorhus/globals) | `17.13.0` | `17.14.0` |
| [prettier](https://github.com/prettier/prettier) | `3.9.10` | `3.10.0` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.72.0` | `8.72.2` |



Updates `follow-redirects` from 1.16.1 to 1.16.3
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.16.1...v1.16.3)

Updates `node-forge` from 1.4.1 to 1.4.3
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.4.1...v1.4.3)

Updates `semver` from 7.8.5 to 7.8.6
- [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.8.5...v7.8.6)

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

Updates `eslint-plugin-import-x` from 4.17.1 to 4.18.1
- [Release notes](https://github.com/un-ts/eslint-plugin-import-x/releases)
- [Changelog](https://github.com/un-ts/eslint-plugin-import-x/blob/master/CHANGELOG.md)
- [Commits](https://github.com/un-ts/eslint-plugin-import-x/compare/v4.17.1...v4.18.1)

Updates `eslint-plugin-jsdoc` from 65.4.0 to 65.4.5
- [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases)
- [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v65.4.0...v65.4.5)

Updates `globals` from 17.13.0 to 17.14.0
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v17.13.0...v17.14.0)

Updates `prettier` from 3.9.10 to 3.10.0
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.9.10...3.10.0)

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

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-version: 1.16.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: node-forge
  dependency-version: 1.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: semver
  dependency-version: 7.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: "@types/sinon"
  dependency-version: 22.0.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: eslint-plugin-import-x
  dependency-version: 4.18.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: eslint-plugin-jsdoc
  dependency-version: 65.4.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
- dependency-name: globals
  dependency-version: 17.14.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: prettier
  dependency-version: 3.10.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor
- dependency-name: typescript-eslint
  dependency-version: 8.72.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-18 17:55:11 +00:00
Mario Campos b2b7b36cdb Merge pull request #4294 from github/mario-campos-changelog-workflow-activation
Warn about direct CHANGELOG.md changes in PR checks
2026-11-18 15:33:41 +00:00
github-actions[bot] 0c7ad84486 Rebuild 2026-11-15 19:41:05 +00:00
dependabot[bot] f874b0c2b2 Bump fast-xml-parser from 5.7.1 to 5.12.1
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 5.7.1 to 5.12.1.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.7.1...v5.12.1)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-version: 5.12.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-15 19:38:34 +00:00
Mario CamposandCopilot App 9e531e1309 Install root dependencies for PR comment action
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-11 00:23:42 -06:00
Mario CamposandCopilot App f039c789cd Warn about direct CHANGELOG.md changes in PR checks
Split workflow activation from #4217 while keeping the comment action loaded from trusted main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-11 00:23:42 -06:00
Mario Campos 3ea37a44b6 Merge pull request #4217 from github/mario-campos/warn-on-changelog-write
Add `post-comment` Action
2026-11-11 04:38:32 +00:00
Henry Mercer 592d162ba3 Merge pull request #4312 from github/henrymercer/all-platform-bundle-checks
Make the "All-platform bundle" PR check use the all-platform bundle
2026-11-10 18:07:39 +00:00
Henry MercerandCopilot App a6827a39de Merge analyze-javascript and analyze-other into one matrixed job
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 18:24:06 +00:00
Henry MercerandCopilot App 4e3aa4135f Remove the CodeQL Bundle All PR check, which duplicates all-platform-bundle
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 17:13:44 +00:00
Henry MercerandCopilot App 91bae3ac68 Check that the all-platform-bundle PR check uses an all-platform bundle
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 17:13:32 +00:00
Henry MercerandCopilot App cfb3940966 Respect use-all-platform-bundle for the latest nightly in prepare-test
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 17:13:08 +00:00
Henry MercerandCopilot App 97d0cc029d Only run analyze-javascript with the default CodeQL bundle
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 15:24:25 +00:00
Henry MercerandCopilot App b5a3632119 Run analyze-javascript only on ubuntu-26.04
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 15:24:25 +00:00
Henry MercerandCopilot App 3a7f564e33 Rerun failed runner-images jobs in the Deflake workflow
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 15:24:25 +00:00
Henry MercerandCopilot App 02e8a5ded2 Run runner-images check on the GitHub-hosted runner images with linked
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 15:24:25 +00:00
Henry MercerandCopilot App 9d4eb28961 Rename linux-arm64 PR check to runner-images
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-09 14:40:11 +00:00
Michael B. Gale fbfa9f3747 Merge pull request #4311 from github/henrymercer/exclude-notify-from-required-checks
Exclude `Notify` from required checks
2026-11-09 13:24:24 +00:00
Henry Mercer ce8b5602e2 Merge pull request #4302 from github/henrymercer/toolcache-cleanup-duration
Report how long toolcache cleanup takes
2026-11-09 12:03:29 +00:00
Henry Mercer e4ce43d857 Merge pull request #4309 from github/henrymercer/replace-macos-14-xlarge-runner
Remove `macos-14-xlarge` from `codeql` workflow
2026-11-09 11:54:44 +00:00
Henry MercerandCopilot App 822e91c47d Exclude Notify from required checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-06 18:24:29 +00:00
Henry MercerandCopilot App d2a785ca9c Remove macos-14-xlarge from codeql workflow
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-06 18:17:27 +00:00
Sam Robson 0911ee96d2 Merge pull request #4303 from github/mergeback/v4.39.3-to-main-33d7b85d
Mergeback v4.39.3 refs/heads/releases/v4 into main
2026-11-04 17:52:12 +00:00
github-actions[bot] d11b2246b1 Rebuild 2026-11-04 16:49:37 +00:00
github-actions[bot] 8e42d3873f Update changelog and version after v4.39.3 2026-11-04 16:49:21 +00:00
Sam Robson 33d7b85da1 Merge pull request #4299 from github/update-v4.39.3-064910ba2
Merge main into releases/v4
2026-11-04 16:47:01 +00:00
Michael B. Gale 8aab3d8601 Merge pull request #4298 from github/mbg/decouple-features-enum
Move `Feature` enum to a separate file
2026-11-04 15:50:28 +00:00
github-actions[bot] 24393f8692 Update changelog for v4.39.3 2026-11-04 15:21:56 +00:00
Henry MercerandCopilot App e70c0414bf Record how long the toolcache cleanup takes in telemetry
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 14:31:49 +00:00
Henry MercerandCopilot App e7ce43a4dc Log how long deleting each CodeQL version from the toolcache takes
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-04 14:27:07 +00:00
Michael B. Gale 064910ba27 Merge pull request #4297 from github/mbg/update-glob
Update `glob` to `14.0.3`
2026-11-04 13:56:56 +00:00
Michael B. Gale f532ac5951 Update glob to 14.0.3 2026-11-04 13:08:55 +00:00
Mario CamposandCopilot App 05870b623f Defer workflow activation to a follow-up PR
Keep the post-comment implementation independent of the workflow that loads it from main.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-11-03 11:13:53 -06:00
Mario Campos 9d1378fb6e Use new case expression for evaluating conditional --update-only flag 2026-11-02 09:23:54 -06:00
Mario Campos 4094755f8c Polish post-comment.ts usage comment 2026-11-02 09:19:54 -06:00
Mario Campos d71593936c Replace --create-if-missing to --update-only
`--update-only` is disabled by default, whereas `--create-if-missing` should've been enabled by default but was not.
2026-10-30 10:41:05 -05:00
Mario Campos 9de5eacd23 Make error a bit clearer and more actionable 2026-10-30 09:56:15 -05:00
Mario Campos 97a381d7b6 Split long line 2026-10-30 09:51:41 -05:00
Mario Campos eec64423e6 Make precedence explicit with parens 2026-10-30 09:50:21 -05:00
Mario Campos 8ba2b06960 Use parseRepositoryNwo instead of splitting manually 2026-10-30 09:49:42 -05:00
Mario Campos b25bc2e8e6 Change RepositoryNwo import to type 2026-10-30 09:43:29 -05:00
Mario Campos 0bc39f9ffc Prefer last comment when there are multiple to choose from 2026-10-30 09:35:55 -05:00
Mario Campos a5878670a9 Update actions/setup-node action to version 7.1.0 2026-10-30 09:28:58 -05:00
Mario Campos 1a18e9047f Merge branch 'main' into mario-campos/warn-on-changelog-write 2026-10-30 09:27:10 -05:00
Mario Campos 68a9dcbb35 Prefer == true over != false 2026-10-29 19:46:00 -05:00
Mario CamposandCopilot Autofix powered by AI 1304cc4df1 Potential fix for pull request finding 'CodeQL / Missing space in string concatenation'
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-10-29 11:37:40 -05:00
Mario CamposandCopilot App 94f0998581 Avoid creating resolved comments without an existing warning
Use a boolean --create-if-missing flag, supplied by the composite action by default and omitted for resolution updates.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-29 11:32:57 -05:00
Mario Campos e9651489af Avoid non-null assertion operators by asserting arguments 2026-10-29 10:44:10 -05:00
Mario Campos 9359b6b571 Wrap --marker argument in HTML comment tags automatically 2026-10-29 10:34:12 -05:00
Mario Campos 19e1ab5452 Update pr-checks/post-comment.ts description comment 2026-10-29 10:28:26 -05:00
Mario Campos f13bcf383f Warn if more than one marked comment was found 2026-10-29 10:20:21 -05:00
Mario Campos 5bb3554330 Make input-validation assertions more granular 2026-10-29 10:13:06 -05:00
Mario Campos 87cac24cdd Avoid sparse checkout
This codebase is a tad coupled; it could end up biting us.
2026-10-29 10:03:32 -05:00
Mario Campos 2902eeab4d Checkout main instead of PR's base for the post-pr-comments job 2026-10-29 10:01:27 -05:00
Mario Campos 56fa196def Use YAML multiline string for the Action's inputs' descriptions 2026-10-29 09:58:48 -05:00
Mario Campos 3fb676f638 Use existing RepositoryNwo type 2026-10-29 09:56:18 -05:00
Mario Campos afaf324646 Move resolveToken to pr-checks/api-client.ts 2026-10-29 09:51:48 -05:00
Mario CamposandCopilot App c069d49e81 Test sticky comments using observable state
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:46:41 -05:00
Mario CamposandCopilot App 36f220a96c Remove unused post-comment step IDs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:08:22 -05:00
Mario CamposandCopilot App 03137fc68d Rename changelog outputs to modified
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:06:08 -05:00
Mario CamposandCopilot App 94488778fd Simplify post-comment to a single set-comment mode
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:00:37 -05:00
Mario CamposandCopilot App ae23865548 Move comment branching into workflow steps
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 15:53:36 -05:00
Mario CamposandCopilot App 90d1bc983c Remove bespoke post-comment argument validation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 15:39:43 -05:00
Mario CamposandCopilot App ae9f97bade Make post-comment marker configurable
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-28 15:30:49 -05:00
Mario Campos e7dadca872 Refactor comment handling logic into performAction for improved testability 2026-10-09 17:35:09 -05:00
Mario Campos f1419b8c76 Reject empty --marker 2026-10-09 17:11:18 -05:00
Mario CamposandCopilot Autofix powered by AI 3c452a182d Use HTTP link to unreleased-change-notes/README.md
Update link in PR checks workflow to point to the correct README.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-09 10:36:48 -05:00
Mario CamposandCopilot Autofix powered by AI 4d464b0697 Improve issue ID parsing and validation logic
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-09 10:35:34 -05:00
Mario Campos 14cefaa03c Replace bash/run step with local Action post-comment 2026-10-08 23:03:55 -05:00
Mario Campos 8c8b0827d5 Add script and Action for managing PR comments 2026-10-08 23:02:25 -05:00
Mario Campos 9fe741e77d Simplify if condition of CHANGELOG-comment-post step 2026-10-08 15:26:56 -05:00
Mario CamposandMichael B. Gale 27d37d97e2 Format all file references as inline Markdown code spans
Co-authored-by: Michael B. Gale <mbg@github.com>
2026-10-08 15:19:38 -05:00
Mario Campos 0707124ab8 Delete CHANGELOG.md-modification comment if CHANGELOG.md no longer modified 2026-10-08 13:11:34 -05:00
Mario CamposandCopilot Autofix powered by AI 928548a094 Refine exclusion conditions for CHANGELOG-modification comment
Refactor conditions for PR title checks in workflow.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-08 12:57:52 -05:00
Mario CamposandCopilot Autofix powered by AI ccdf69089a Escape backticks PR comment body
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-10-08 12:55:10 -05:00
Mario Campos d97a656f70 Update CHANGELOG.md warning message to reference change-notes directory 2026-10-08 12:41:52 -05:00
Mario Campos 6e4d3fb63d Use a sticky comment to warn about CHANGELOG.md changes 2026-10-08 12:31:10 -05:00
Mario Campos ae75d466ce Exclude "Mergeback" and "Update default bundle" PRs from CHANGELOG.md change warning 2026-10-08 12:11:29 -05:00
Mario Campos 780e947861 Skip CHANGELOG.md modification warning for release and backport PRs 2026-10-08 11:48:09 -05:00
Mario Campos f7aa9dc1ba Move post-comment step to post-pr-comments job 2026-10-08 11:40:38 -05:00
Mario Campos 43ac64c267 Use gh api instead of third-party Action 2026-10-08 11:16:19 -05:00
Mario Campos fbd33ac6fc Gate comment-post step on successful fetch-base 2026-10-08 10:50:34 -05:00
Mario Campos b2b77a81a2 Add CHANGELOG.md modification check and warning comment 2026-10-08 10:47:46 -05:00
70 changed files with 8164 additions and 4833 deletions

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
name: "Post comment"
description: "Create or update a sticky PR comment identified by a caller-provided marker."
inputs:
marker:
description: >
Non-empty plain-text identifier for the comment. Use a unique, stable value
for each distinct comment; it is automatically wrapped in a hidden HTML comment.
required: true
body:
description: "Full comment markdown."
required: true
update-only:
description: Do nothing if no comment with the specified marker exists.
required: false
default: "false"
issue-id:
description: >
The issue or pull request number to post/update the comment on.
Defaults to the current pull request if not provided.
required: false
token:
description: "The GitHub token to authenticate with."
required: true
runs:
using: composite
steps:
- name: Post comment
shell: bash
env:
BODY: ${{ inputs.body }}
MARKER: ${{ inputs.marker }}
UPDATE_ONLY: ${{ case(inputs.update-only == 'true', '--update-only', '') }}
GH_TOKEN: ${{ inputs.token }}
ISSUE_ID: ${{ inputs.issue-id || github.event.pull_request.number }}
run: |
npx tsx ./pr-checks/post-comment.ts \
--body "$BODY" \
--marker "$MARKER" \
$UPDATE_ONLY \
--issue-id "$ISSUE_ID" \
--repository "$GITHUB_REPOSITORY"
+8 -1
View File
@@ -36,7 +36,14 @@ runs:
set -e # Fail this Action if `gh release list` fails.
if [[ "$VERSION" == "nightly" || "$VERSION" == "nightly-latest" ]]; then
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
if [[ "$USE_ALL_PLATFORM_BUNDLE" == "true" ]]; then
# With `tools: nightly`, the Action downloads the bundle for the runner's platform, so look
# up the latest nightly release here to get its all-platform bundle instead.
tag=$(gh release list --repo dsp-testing/codeql-cli-nightlies --limit 1 --json tagName --jq '.[0].tagName')
echo "tools-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$tag/codeql-bundle.tar.gz" >> "$GITHUB_OUTPUT"
else
echo "tools-url=nightly" >> "$GITHUB_OUTPUT"
fi
exit 0
elif [[ "$VERSION" == "linked" ]]; then
echo "tools-url=linked" >> "$GITHUB_OUTPUT"
+5
View File
@@ -0,0 +1,5 @@
paths-ignore:
- lib
- tests
queries:
- uses: security-and-quality
+14 -2
View File
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
@@ -92,6 +92,18 @@ jobs:
# Swift is not supported on Ubuntu so we manually exclude it from the list here
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check that the bundle contains tools for all platforms
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
# Platform-specific bundles only contain the tools for their own platform.
tools_dir="$(dirname "$CODEQL_PATH")/tools"
for platform in linux64 osx64 win64; do
if [[ ! -d "$tools_dir/$platform" ]]; then
echo "::error::Expected an all-platform CodeQL bundle, but '$tools_dir' does not contain a '$platform' directory."
exit 1
fi
done
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
+2 -2
View File
@@ -67,11 +67,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+1 -1
View File
@@ -61,7 +61,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Prepare test
@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Java
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin
+1 -1
View File
@@ -63,7 +63,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Java
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
java-version: ${{ inputs.java-version || '17' }}
distribution: temurin
+2 -2
View File
@@ -67,11 +67,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -69,11 +69,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
@@ -57,7 +57,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
@@ -73,7 +73,7 @@ jobs:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
# Deliberately change Go after the `init` step
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.20"
- name: Build code
@@ -57,7 +57,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+1 -1
View File
@@ -57,7 +57,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+1 -1
View File
@@ -77,7 +77,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+1 -1
View File
@@ -77,7 +77,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+1 -1
View File
@@ -77,7 +77,7 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -67,11 +67,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -101,11 +101,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -69,11 +69,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
@@ -3,7 +3,7 @@
# pr-checks/sync.sh
# to regenerate this file.
name: PR Check - Linux Arm64
name: PR Check - Runner images
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
@@ -47,16 +47,38 @@ defaults:
shell: bash
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
group: linux-arm64-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}}
group: runner-images-${{github.ref}}-${{inputs.dotnet-version}}-${{inputs.go-version}}
jobs:
linux-arm64:
runner-images:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
version: linked
- os: ubuntu-22.04-arm
version: linked
- os: ubuntu-24.04
version: linked
- os: ubuntu-24.04-arm
version: nightly-latest
name: Linux Arm64
version: linked
- os: ubuntu-26.04
version: linked
- os: ubuntu-26.04-arm
version: linked
- os: windows-2022
version: linked
- os: windows-2025
version: linked
- os: macos-15-large
version: linked
- os: macos-15-xlarge
version: linked
- os: macos-26-large
version: linked
- os: macos-26-xlarge
version: linked
name: Runner images
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
@@ -67,11 +89,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
@@ -102,5 +124,5 @@ jobs:
echo "Found database for $lang"
done
env:
LANGUAGES: cpp,csharp,go,java,javascript,python,ruby
LANGUAGES: cpp,csharp,go,java,javascript,python,ruby${{ startsWith(matrix.os, 'macos') && ',swift' || '' }}
CODEQL_ACTION_TEST_MODE: true
+2 -2
View File
@@ -77,11 +77,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -71,11 +71,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -69,11 +69,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -67,11 +67,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -74,11 +74,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+2 -2
View File
@@ -68,11 +68,11 @@ jobs:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: ${{ inputs.dotnet-version || '9.x' }}
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ${{ inputs.go-version || '>=1.21.0' }}
cache: false
+7 -95
View File
@@ -19,70 +19,16 @@ env:
CODEQL_ACTION_TESTING_ENVIRONMENT: codeql-action-pr-checks
jobs:
# Identify the CodeQL tool versions to use in the analysis job.
check-codeql-versions:
analyze:
if: github.triggering_actor != 'dependabot[bot]'
runs-on: ubuntu-26.04
outputs:
versions: ${{ steps.compare.outputs.versions }}
permissions:
contents: read
# We currently need `security-events: read` to access feature flags.
security-events: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up default CodeQL bundle
id: setup-default
uses: ./setup-codeql
- name: Set up linked CodeQL bundle
id: setup-linked
uses: ./setup-codeql
with:
tools: linked
- name: Compare default and linked CodeQL bundle versions
id: compare
env:
CODEQL_DEFAULT: ${{ steps.setup-default.outputs.codeql-path }}
CODEQL_LINKED: ${{ steps.setup-linked.outputs.codeql-path }}
run: |
CODEQL_VERSION_DEFAULT="$("$CODEQL_DEFAULT" version --format terse)"
CODEQL_VERSION_LINKED="$("$CODEQL_LINKED" version --format terse)"
echo "Default CodeQL bundle version is $CODEQL_VERSION_DEFAULT"
echo "Linked CodeQL bundle version is $CODEQL_VERSION_LINKED"
# If we're running on a pull request, run with both bundles, even if `tools: linked` would
# be the same as `tools: null`. This allows us to make the job for each of the bundles a
# required status check.
#
# If we're running on push or schedule, then we can skip running with `tools: linked` when it would be
# the same as running with `tools: null`.
if [[ "$GITHUB_EVENT_NAME" != "pull_request" && "$GITHUB_EVENT_NAME" != "merge_group" && "$CODEQL_VERSION_DEFAULT" == "$CODEQL_VERSION_LINKED" ]]; then
VERSIONS_JSON='[null]'
else
VERSIONS_JSON='[null, "linked"]'
fi
# Output a JSON-encoded list with the distinct versions to test against.
echo "Suggested matrix config for analysis job: $VERSIONS_JSON"
echo "versions=${VERSIONS_JSON}" >> $GITHUB_OUTPUT
analyze-javascript:
if: github.triggering_actor != 'dependabot[bot]'
needs: [check-codeql-versions]
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04
- windows-2022
- windows-2025
- macos-14-xlarge
- macos-15-xlarge
tools: ${{ fromJson(needs.check-codeql-versions.outputs.versions) }}
runs-on: ${{ matrix.os }}
language:
- actions
- javascript
permissions:
contents: read
@@ -95,49 +41,15 @@ jobs:
uses: ./init
id: init
with:
languages: javascript
config-file: ./.github/codeql/codeql-config-javascript.yml
tools: ${{ matrix.tools }}
languages: ${{ matrix.language }}
build-mode: none
config-file: ./.github/codeql/codeql-config-${{ matrix.language }}.yml
# confirm steps.init.outputs.codeql-path points to the codeql binary
- name: Print CodeQL Version
run: >
"$CODEQL" version --format=json
env:
CODEQL: ${{steps.init.outputs.codeql-path}}
- name: Perform CodeQL Analysis
uses: ./analyze
with:
category: "/language:javascript"
upload: ${{ (matrix.os == 'ubuntu-24.04' && !matrix.tools && github.event_name != 'merge_group' && 'always' ) || 'never' }}
analyze-other:
if: github.triggering_actor != 'dependabot[bot]'
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
include:
- language: actions
permissions:
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Initialize CodeQL
uses: ./init
with:
languages: ${{ matrix.language }}
build-mode: none
config: >
paths-ignore:
- lib
- tests
queries:
- uses: security-and-quality
- name: Perform CodeQL Analysis
uses: ./analyze
with:
@@ -59,11 +59,11 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ^1.13.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: "9.x"
- name: Assert best-effort artifact scan completed
+2 -2
View File
@@ -55,11 +55,11 @@ jobs:
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: ^1.13.1
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
with:
dotnet-version: "9.x"
- name: Assert best-effort artifact scan completed
+17 -17
View File
@@ -6,19 +6,19 @@ name: Deflake
on:
workflow_run:
types: [completed]
# Exclude workflows that have significant side effects, like publishing releases. It's OK to
# retry CodeQL analysis.
# Generated by `pr-checks/sync.sh` from the templates in `pr-checks/checks` and the other
# workflows listed in `pr-checks/deflake.ts`.
workflows:
- Check Expected Release Files
- Code-Scanning config CLI tests
- CodeQL action
- Manual Check - go
- "Check Expected Release Files"
- "Code-Scanning config CLI tests"
- "CodeQL action"
- "Manual Check - go"
- "PR Check - All-platform bundle"
- "PR Check - Analysis kinds"
- "PR Check - Analyze: 'ref' and 'sha' from inputs"
- "PR Check - autobuild-action"
- "PR Check - Autobuild direct tracing (custom working directory)"
- "PR Check - Autobuild working directory"
- "PR Check - autobuild-action"
- "PR Check - Build mode autobuild"
- "PR Check - Build mode manual"
- "PR Check - Build mode none"
@@ -26,23 +26,22 @@ on:
- "PR Check - Bundle: Caching checks"
- "PR Check - Bundle: From nightly"
- "PR Check - Bundle: From toolcache"
- "PR Check - Bundle: Zstandard checks"
- "PR Check - C/C\\+\\+: autoinstalling dependencies (Linux)"
- "PR Check - C/C\\+\\+: autoinstalling dependencies is skipped (macOS)"
- "PR Check - C/C\\+\\+: disabling autoinstalling dependencies (Linux)"
- "PR Check - Clean up database cluster directory"
- "PR Check - CodeQL Bundle All"
- "PR Check - Config export"
- "PR Check - Config input"
- "PR Check - Custom source root"
- "PR Check - Debug artifact upload"
- "PR Check - Debug artifacts after failure"
- "PR Check - Diagnostic export"
- "PR Check - Diagnostic export without database"
- "PR Check - Export file baseline information"
- "PR Check - Extractor ram and threads options test"
- "PR Check - Go: Custom queries"
- "PR Check - Go: diagnostic when Go is changed after init step"
- "PR Check - Go: diagnostic when `file` is not installed"
- "PR Check - Go: diagnostic when Go is changed after init step"
- "PR Check - Go: tracing with autobuilder step"
- "PR Check - Go: tracing with custom build steps"
- "PR Check - Go: tracing with legacy workflow"
@@ -57,10 +56,12 @@ on:
- "PR Check - Packaging: Config and input passed to the CLI"
- "PR Check - Packaging: Config file"
- "PR Check - Packaging: Download using registries"
- "PR Check - Per-language bundles"
- "PR Check - Proxy test"
- "PR Check - Remote config file"
- "PR Check - Resolve environment"
- "PR Check - Ruby analysis"
- "PR Check - Runner images"
- "PR Check - Rust analysis"
- "PR Check - Split workflow"
- "PR Check - Start proxy"
@@ -69,19 +70,18 @@ on:
- "PR Check - Swift analysis using autobuild"
- "PR Check - Test different uses of `upload-sarif`"
- "PR Check - Test unsetting environment variables"
- "PR Check - Upload-sarif: ref and sha from inputs"
- "PR Check - Unsupported macOS"
- "PR Check - Upload-sarif: 'ref' and 'sha' from inputs"
- "PR Check - Use a custom `checkout_path`"
- PR Checks
- Query filters tests
- Test that the workaround for python 3.12 on windows works
- "PR Checks"
- "Query filters tests"
- "Test that the workaround for python 3.12 on windows works"
jobs:
rerun-on-failure:
name: Rerun failed jobs
if: >-
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.run_attempt == 1 &&
(
github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt == 1 && (
github.event.workflow_run.head_branch == 'main' ||
startsWith(github.event.workflow_run.head_branch, 'releases/') ||
github.event.workflow_run.event == 'merge_group'
+1 -1
View File
@@ -134,7 +134,7 @@ jobs:
echo "::endgroup::"
- name: Generate token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
+73 -2
View File
@@ -95,6 +95,8 @@ jobs:
contents: read
runs-on: ubuntu-26.04
timeout-minutes: 10
outputs:
changelog-modified: ${{ steps.changelog-check.outputs.modified }}
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
@@ -191,6 +193,20 @@ jobs:
path: ${{ runner.temp }}/repo-size/
if-no-files-found: error
- name: Check for CHANGELOG.md changes
id: changelog-check
if: steps.fetch-base.outcome == 'success'
env:
BASE_SHA: ${{ steps.fetch-base.outputs.merge_base }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
if ! git diff --exit-code --quiet "$BASE_SHA" "$HEAD_SHA" -- CHANGELOG.md; then
echo "CHANGELOG.md was modified in this PR."
echo "modified=true" >> "$GITHUB_OUTPUT"
else
echo "modified=false" >> "$GITHUB_OUTPUT"
fi
- name: "Backport: Check out base ref"
id: checkout-base
if: ${{ startsWith(github.head_ref, 'backport-') }}
@@ -211,8 +227,8 @@ jobs:
exit 1
fi
post-repo-size-comment:
name: Post repo size comment
post-pr-comments:
name: Post PR comments
needs: other-checks
# Keep write permissions isolated from the job that checks out and tests PR code. This job only
# posts the candidate comment body produced by the read-only `pr-checks` job.
@@ -232,6 +248,22 @@ jobs:
group: check-repo-size-${{ github.event.pull_request.number }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Check out main, not the PR's head, since this job runs with
# `pull-requests: write` permissions and must not execute untrusted code from the PR.
ref: main
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: "npm"
- name: Install dependencies
run: npm ci --workspace=pr-checks --include-workspace-root
- name: Download repo size comment
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
@@ -261,3 +293,42 @@ jobs:
else
echo "Skipping repo size comment because the delta is below the threshold and no sticky comment exists."
fi
- name: Post a warning about modifying CHANGELOG.md
# Release, backport, mergeback, and bundle-update PRs deliberately modify CHANGELOG.md,
# so skip comment management entirely for these automation flows.
if: >-
needs.other-checks.outputs.changelog-modified == 'true' &&
!startsWith(github.event.pull_request.head.ref, 'update-v') &&
!startsWith(github.event.pull_request.head.ref, 'backport-v') &&
!startsWith(github.event.pull_request.head.ref, 'mergeback/') &&
!startsWith(github.event.pull_request.head.ref, 'update-bundle/')
uses: ./.github/actions/post-comment
with:
marker: "post-comment:CHANGELOG.md"
body: |
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`
file will be automatically generated from those change-notes.
See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information.
token: ${{ secrets.GITHUB_TOKEN }}
- name: Mark the CHANGELOG.md concern as resolved
if: >-
needs.other-checks.outputs.changelog-modified == 'false' &&
!startsWith(github.event.pull_request.head.ref, 'update-v') &&
!startsWith(github.event.pull_request.head.ref, 'backport-v') &&
!startsWith(github.event.pull_request.head.ref, 'mergeback/') &&
!startsWith(github.event.pull_request.head.ref, 'update-bundle/')
uses: ./.github/actions/post-comment
with:
marker: "post-comment:CHANGELOG.md"
update-only: true
body: |
⚠️ `CHANGELOG.md` has been modified in this PR. Please do not modify `CHANGELOG.md` directly.
Instead, create a change-note file in `unreleased-change-notes/`. The `CHANGELOG.md`
file will be automatically generated from those change-notes.
See [`unreleased-change-notes/README.md`](https://github.com/github/codeql-action/blob/main/unreleased-change-notes/README.md) for more information.
**Edit:** `CHANGELOG.md` is no longer modified in this PR. This concern is resolved.
token: ${{ secrets.GITHUB_TOKEN }}
+1 -1
View File
@@ -139,7 +139,7 @@ jobs:
- name: Generate token
if: github.event_name == 'workflow_dispatch'
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
@@ -1,62 +0,0 @@
name: "PR Check - CodeQL Bundle All"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
on:
push:
branches:
- main
- releases/v*
pull_request:
merge_group:
types: [checks_requested]
schedule:
- cron: "0 5 * * *"
workflow_dispatch:
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' || false }}
group: ${{ github.workflow }}-${{ github.ref }}
defaults:
run:
shell: bash
jobs:
test-codeql-bundle-all:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-26.04
version: nightly-latest
name: "CodeQL Bundle All"
if: github.triggering_actor != 'dependabot[bot]'
permissions:
contents: read
security-events: read
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
use-all-platform-bundle: true
- name: Install .NET
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: "9.x"
- id: init
uses: ./../action/init
with:
# We manually exclude Swift from the languages list here, as it is not supported on Ubuntu
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
env:
CODEQL_ACTION_TEST_MODE: true
+1 -1
View File
@@ -95,7 +95,7 @@ jobs:
pull-requests: write # needed to create pull request
steps:
- name: Generate token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
id: app-token
with:
app-id: ${{ vars.AUTOMATION_APP_ID }}
+12
View File
@@ -6,6 +6,18 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
No user facing changes.
## 4.39.5 - 24 Nov 2026
- Update default CodeQL bundle version to [2.27.6](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.6). [#4347](https://github.com/github/codeql-action/pull/4347)
## 4.39.4 - 20 Nov 2026
- Update default CodeQL bundle version to [2.27.5](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.5). [#4333](https://github.com/github/codeql-action/pull/4333)
## 4.39.3 - 04 Nov 2026
- Fixed diff-informed alert filtering incorrectly removing alerts in changed files whose paths contain spaces, special characters, or non-ASCII characters. [#4283](https://github.com/github/codeql-action/pull/4283)
## 4.39.2 - 03 Nov 2026
- Update default CodeQL bundle version to [2.27.4](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.27.4). [#4284](https://github.com/github/codeql-action/pull/4284)
+2 -2
View File
@@ -154,8 +154,8 @@ inputs:
trap-caching:
description: >-
Explicitly enable or disable TRAP caching instead of using the automatically determined default.
TRAP caching is disabled by default when improved incremental analysis is enabled,
because improved incremental analysis of a pull request only extracts changed files,
TRAP caching is disabled by default when overlay analysis is enabled,
because overlay analysis of a pull request only extracts changed files,
which rarely benefit from TRAP caching.
required: false
dependency-caching:
+4 -4
View File
@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.27.4",
"cliVersion": "2.27.4",
"priorBundleVersion": "codeql-bundle-v2.27.3",
"priorCliVersion": "2.27.3"
"bundleVersion": "codeql-bundle-v2.27.6",
"cliVersion": "2.27.6",
"priorBundleVersion": "codeql-bundle-v2.27.5",
"priorCliVersion": "2.27.5"
}
+6287 -4013
View File
File diff suppressed because it is too large. Load diff
+517 -479
View File
File diff suppressed because it is too large. Load diff
+16 -13
View File
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "4.39.3",
"version": "4.39.6",
"private": true,
"description": "CodeQL action",
"scripts": {
@@ -37,14 +37,14 @@
"@octokit/plugin-rest-endpoint-methods": "^18.0.0",
"@octokit/plugin-retry": "^8.1.1",
"archiver": "^8.0.0",
"follow-redirects": "^1.16.1",
"follow-redirects": "^1.16.3",
"get-folder-size": "^5.0.0",
"https-proxy-agent": "^7.0.6",
"js-yaml": "^5.5.0",
"jsonschema": "1.5.0",
"long": "^5.3.2",
"node-forge": "^1.4.1",
"semver": "^7.8.5",
"node-forge": "^1.4.4",
"semver": "^7.8.6",
"undici": "^7.30.1",
"uuid": "^14.0.3"
},
@@ -60,22 +60,22 @@
"@types/node-forge": "^1.3.14",
"@types/sarif": "^2.1.7",
"@types/semver": "^7.8.0",
"@types/sinon": "^22.0.1",
"ava": "^6.4.1",
"@types/sinon": "^22.0.2",
"ava": "^7.0.0",
"esbuild": "^0.28.2",
"eslint": "^9.39.5",
"eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-github": "^6.1.2",
"eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jsdoc": "^65.4.0",
"eslint-plugin-import-x": "^4.18.1",
"eslint-plugin-jsdoc": "^65.4.12",
"eslint-plugin-no-async-foreach": "^0.1.1",
"glob": "^13.0.6",
"globals": "^17.13.0",
"glob": "^14.0.3",
"globals": "^17.14.0",
"nock": "^14.0.17",
"prettier": "^3.9.10",
"prettier": "^3.10.1",
"sinon": "^22.1.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.72.0"
"typescript-eslint": "^8.73.0"
},
"overrides": {
"@actions/tool-cache": {
@@ -90,13 +90,16 @@
"@octokit/plugin-paginate-rest": {
"semver": ">=9.2.2"
},
"archiver@^8.0.0": {
"readdir-glob": "^4.0.0"
},
"eslint-plugin-import": {
"semver": ">=6.3.1"
},
"eslint-plugin-jsx-a11y": {
"semver": ">=6.3.1"
},
"glob": "^13.0.6",
"glob": "^14.0.3",
"undici": "^7.30.1"
}
}
+11
View File
@@ -8,3 +8,14 @@ export function getApiClient(token: string): ApiClient {
const opts = githubUtils.getOctokitOptions(token);
return new githubUtils.GitHub(opts);
}
/** Resolves the GitHub API token to use, from `GH_TOKEN` or `GITHUB_TOKEN`. */
export function resolveToken(env: NodeJS.ProcessEnv): string {
const token = env.GH_TOKEN?.trim() || env.GITHUB_TOKEN?.trim();
if (!token) {
throw new Error(
"Missing authentication token. Set GH_TOKEN or GITHUB_TOKEN.",
);
}
return token;
}
+12
View File
@@ -17,6 +17,18 @@ steps:
# Swift is not supported on Ubuntu so we manually exclude it from the list here
languages: cpp,csharp,go,java,javascript,python,ruby
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Check that the bundle contains tools for all platforms
env:
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
run: |
# Platform-specific bundles only contain the tools for their own platform.
tools_dir="$(dirname "$CODEQL_PATH")/tools"
for platform in linux64 osx64 win64; do
if [[ ! -d "$tools_dir/$platform" ]]; then
echo "::error::Expected an all-platform CodeQL bundle, but '$tools_dir' does not contain a '$platform' directory."
exit 1
fi
done
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
@@ -12,7 +12,7 @@ steps:
languages: go
tools: ${{ steps.prepare-test.outputs.tools-url }}
# Deliberately change Go after the `init` step
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
- uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
with:
go-version: "1.20"
- name: Build code
-35
View File
@@ -1,35 +0,0 @@
name: "Linux Arm64"
description: "An end-to-end integration test running on a Linux Arm64 runner, checking that the native linux-arm64 CodeQL bundle is downloaded and can analyze interpreted and compiled code"
operatingSystems:
- os: ubuntu
runner-image: ubuntu-24.04-arm
# The native linux-arm64 CodeQL bundle is only available in recent CLI releases, so we restrict this
# check to `nightly-latest`, which is guaranteed to ship it. Older stable versions do not have an
# arm64 asset, and `prepare-test` would resolve an x64 bundle URL for them on this runner.
versions:
- nightly-latest
installGo: true
installDotNet: true
# The set of languages CodeQL supports on this platform, excluding Swift (macOS only).
env:
LANGUAGES: cpp,csharp,go,java,javascript,python,ruby
steps:
- uses: ./../action/init
with:
languages: ${{ env.LANGUAGES }}
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
- name: Assert databases exist
run: |
cd "$RUNNER_TEMP/codeql_databases"
for lang in ${LANGUAGES//,/ }; do
if [[ ! -d "$lang" ]]; then
echo "Did not find a database for $lang"
exit 1
fi
echo "Found database for $lang"
done
+67
View File
@@ -0,0 +1,67 @@
name: "Runner images"
description: "An end-to-end integration test checking that CodeQL can analyze interpreted and compiled code on the GitHub-hosted runner images"
# This check runs on each image listed in
# https://github.com/actions/runner-images#available-images, except for:
# - `ubuntu-slim`, which is intended for lightweight jobs rather than builds like this one.
# - `windows-11-arm` and `windows-11-vs2026-arm`, since CodeQL doesn't support Windows on Arm64.
# - `xcode-27` and `xcode-27-xlarge`, since traced analysis is unsupported on macOS 27 and
# the `unsupported-macos` check covers this image.
operatingSystems:
# The Ubuntu 22.04 images have brownouts from 23 March 2027 and are retired on 17 April 2027, so
# remove them before the brownouts start.
# See https://github.com/actions/runner-images/issues/14254.
- os: ubuntu
runner-image: ubuntu-22.04
- os: ubuntu
runner-image: ubuntu-22.04-arm
- os: ubuntu
runner-image: ubuntu-24.04
- os: ubuntu
runner-image: ubuntu-24.04-arm
- os: ubuntu
runner-image: ubuntu-26.04
- os: ubuntu
runner-image: ubuntu-26.04-arm
- os: windows
runner-image: windows-2022
- os: windows
runner-image: windows-2025
# Use larger runners for macOS to keep these jobs off the critical path.
- os: macos
runner-image: macos-15-large
- os: macos
runner-image: macos-15-xlarge
- os: macos
runner-image: macos-26-large
- os: macos
runner-image: macos-26-xlarge
# Other PR checks cover the supported CodeQL versions, so this check only tests the linked version.
# Linux Arm64 bundles are only available for CodeQL 2.27.0 and later, so older stable versions
# can't run on the Arm64 images.
versions:
- linked
installGo: true
installDotNet: true
# The languages to build and analyze. CodeQL only supports Swift on macOS.
env:
LANGUAGES: "cpp,csharp,go,java,javascript,python,ruby${{ startsWith(matrix.os, 'macos') && ',swift' || '' }}"
steps:
- uses: ./../action/init
with:
languages: ${{ env.LANGUAGES }}
tools: ${{ steps.prepare-test.outputs.tools-url }}
- name: Build code
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
- name: Assert databases exist
run: |
cd "$RUNNER_TEMP/codeql_databases"
for lang in ${LANGUAGES//,/ }; do
if [[ ! -d "$lang" ]]; then
echo "Did not find a database for $lang"
exit 1
fi
echo "Found database for $lang"
done
+142
View File
@@ -0,0 +1,142 @@
#!/usr/bin/env npx tsx
/*
Tests for `deflake.ts`.
*/
import * as assert from "node:assert/strict";
import { describe, it } from "node:test";
import { escapeWorkflowName, setWorkflowRunWorkflows } from "./deflake";
describe("escapeWorkflowName", async () => {
await it("escapes the characters that filter patterns treat as glob syntax", () => {
assert.equal(
escapeWorkflowName(
String.raw`!Name with C/C++, [a-z]?, *, ! and \ in it`,
),
String.raw`\!Name with C/C\+\+, \[a-z]\?, \*, \! and \\ in it`,
);
});
await it("leaves names without glob syntax unchanged", () => {
const name = "PR Check - Upload-sarif: 'ref' and `sha` (Linux) ]";
assert.equal(escapeWorkflowName(name), name);
});
});
describe("setWorkflowRunWorkflows", async () => {
await it("replaces the list with sorted, escaped names and leaves the rest of the workflow unchanged", () => {
const workflow = `on:
workflow_run:
types: [completed]
# A comment about the list.
workflows:
- Existing workflow
# A comment within the list.
- "Removed workflow"
jobs:
rerun:
if: |-
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.run_attempt == 1
`;
assert.equal(
setWorkflowRunWorkflows(workflow, [
"PR Check - b",
"PR Check - C/C++",
"Existing workflow",
"PR Check - a",
]),
String.raw`on:
workflow_run:
types: [completed]
# A comment about the list.
workflows:
- "Existing workflow"
- "PR Check - a"
- "PR Check - b"
- "PR Check - C/C\\+\\+"
jobs:
rerun:
if: |-
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.run_attempt == 1
`,
);
});
await it("uses single quotes only for patterns that contain double quotes and no backslashes", () => {
// These are the quotes that Prettier uses when formatting these strings.
assert.equal(
setWorkflowRunWorkflows(
"on:\n workflow_run:\n workflows:\n - Old\n",
['Upload "quoted" SARIF', `It's "quoted"`, 'C++ "quoted"'],
),
String.raw`on:
workflow_run:
workflows:
- "C\\+\\+ \"quoted\""
- 'It''s "quoted"'
- 'Upload "quoted" SARIF'
`,
);
});
await it("leaves comments and keys after the last item unchanged", () => {
const after = ` # A comment after the list.
branches: [main]
`;
assert.equal(
setWorkflowRunWorkflows(
`on:\n workflow_run:\n workflows:\n - Old\n${after}`,
["New"],
),
`on:\n workflow_run:\n workflows:\n - "New"\n${after}`,
);
});
await it("returns an up-to-date workflow unchanged", () => {
const workflow = String.raw`on:
workflow_run:
workflows:
- "C/C\\+\\+"
- "Other"
`;
assert.equal(
setWorkflowRunWorkflows(workflow, ["Other", "C/C++"]),
workflow,
);
});
await it("writes a flow sequence as a block sequence", () => {
assert.equal(
setWorkflowRunWorkflows("on:\n workflow_run:\n workflows: [Old]\n", [
"New",
]),
'on:\n workflow_run:\n workflows:\n - "New"\n',
);
});
await it("throws if the workflow isn't valid YAML", () => {
// Duplicate keys are an error in the `yaml` library, though Prettier accepts them.
assert.throws(
() =>
setWorkflowRunWorkflows(
"on:\n workflow_run:\n workflows:\n - Old\njobs: {}\njobs: {}\n",
["New"],
),
/Failed to parse the workflow: .* at line 6, column 1/,
);
});
await it("throws if the workflow has no workflow_run trigger", () => {
assert.throws(
() => setWorkflowRunWorkflows("on:\n push: {}\n", ["Other"]),
/Expected `on.workflow_run.workflows` to be a sequence/,
);
});
});
+111
View File
@@ -0,0 +1,111 @@
import * as fs from "fs";
import * as path from "path";
import * as yaml from "yaml";
import { REPO_ROOT } from "./config";
/** The path of the workflow that reruns failed jobs in other workflows. */
const DEFLAKE_WORKFLOW_FILE = path.join(
REPO_ROOT,
".github",
"workflows",
"deflake.yml",
);
/**
* The names of workflows that `sync.ts` doesn't generate, but whose failed jobs the Deflake
* workflow should rerun.
*
* Exclude workflows that have significant side effects, like publishing releases. It's OK to retry
* CodeQL analysis.
*/
const NON_GENERATED_WORKFLOWS_TO_RERUN = [
"Check Expected Release Files",
"Code-Scanning config CLI tests",
"CodeQL action",
"PR Check - Debug artifact upload",
"PR Check - Debug artifacts after failure",
"PR Checks",
"Query filters tests",
"Test that the workaround for python 3.12 on windows works",
];
/**
* Escapes the characters in a workflow name that `on.workflow_run.workflows` would otherwise treat
* as glob syntax.
*
* @returns A pattern that matches only the workflow called `name`.
*/
export function escapeWorkflowName(name: string): string {
// These are the characters that can be escaped in GitHub Actions filter patterns. `]` is only
// special after an unescaped `[`, so it doesn't need escaping.
return name.replace(/[\\[?*+!]/g, "\\$&");
}
/**
* Replaces the items in the `on.workflow_run.workflows` list of a workflow, and any comments on
* their lines or between them, with patterns that match the workflows called `workflowNames`,
* sorted by name. The list is written as a block sequence.
*
* The whole workflow is rewritten with the `yaml` library, so any other parts that aren't
* formatted the way that library formats them are reformatted, for example by joining lines of
* folded (`>`) block scalars. Prettier, which checks the formatting of YAML files in this
* repository, formats non-empty flow mappings, and flow sequences that don't fit within 80
* columns, differently from that library, so the workflow is expected not to contain any.
*
* @param workflow The contents of the workflow file.
* @param workflowNames The names of the workflows that should trigger the workflow.
* @returns The updated contents of the workflow file.
* @throws If the workflow isn't valid YAML, or `on.workflow_run.workflows` isn't a sequence.
*/
export function setWorkflowRunWorkflows(
workflow: string,
workflowNames: string[],
): string {
const document = yaml.parseDocument(workflow);
if (document.errors.length > 0) {
throw new Error(
`Failed to parse the workflow: ${document.errors[0].message}`,
);
}
const workflows = document.getIn(["on", "workflow_run", "workflows"], true);
if (!yaml.isSeq(workflows)) {
throw new Error("Expected `on.workflow_run.workflows` to be a sequence.");
}
workflows.flow = false;
workflows.items = workflowNames
.toSorted((a, b) => a.localeCompare(b, "en"))
.map((name) => {
const pattern = escapeWorkflowName(name);
const item = new yaml.Scalar(pattern);
// Quote the pattern in the same way as Prettier, which uses single quotes for strings that
// contain `"` but no `\`, and double quotes otherwise.
item.type =
pattern.includes('"') && !pattern.includes("\\")
? yaml.Scalar.QUOTE_SINGLE
: yaml.Scalar.QUOTE_DOUBLE;
return item;
});
// These options match how Prettier formats short flow sequences, such as `[completed]`, and long
// strings.
return document.toString({ flowCollectionPadding: false, lineWidth: 0 });
}
/**
* Updates the Deflake workflow so that it reruns failed jobs in the workflows called
* `generatedWorkflowNames` and in {@link NON_GENERATED_WORKFLOWS_TO_RERUN}.
*/
export function updateDeflakeWorkflow(generatedWorkflowNames: string[]): void {
console.log(`Updating the list of workflows in '${DEFLAKE_WORKFLOW_FILE}'.`);
const workflow = fs.readFileSync(DEFLAKE_WORKFLOW_FILE, "utf8");
fs.writeFileSync(
DEFLAKE_WORKFLOW_FILE,
setWorkflowRunWorkflows(workflow, [
...generatedWorkflowNames,
...NON_GENERATED_WORKFLOWS_TO_RERUN,
]),
"utf8",
);
}
+3 -1
View File
@@ -15,7 +15,7 @@ is:
- "copilot-pull-request-reviewer"
- "Dependabot"
- "Label PR with size"
- "Post repo size comment"
- "Post PR comments"
- "Prepare"
- "Release info"
- "Upload results"
@@ -24,3 +24,5 @@ is:
# PRs), so requiring them would block the PRs they don't run on.
- "github-advanced-security"
- "License compliance check"
# Only runs when a PR is removed from the merge queue.
- "Notify"
+1 -1
View File
@@ -17,7 +17,7 @@
"glob": "^14.0.3",
"lite-matter": "^0.1.2",
"mdast-util-from-markdown": "^2.1.0",
"semver": "^7.8.5",
"semver": "^7.8.6",
"yaml": "^2.9.1"
},
"devDependencies": {
+344
View File
@@ -0,0 +1,344 @@
#!/usr/bin/env npx tsx
/*
Tests for post-comment.ts.
*/
import * as assert from "node:assert/strict";
import { describe, it } from "node:test";
import { type ApiClient, resolveToken } from "./api-client";
import {
findExistingComment,
type Options,
parseOptions,
setComment,
} from "./post-comment";
/** A baseline set of valid CLI flags, as an array, for use in parseOptions tests. */
const validFlags = [
"--body",
"hello",
"--marker",
"marker",
"--issue-id",
"42",
"--repository",
"github/codeql-action",
];
/** Returns a copy of `validFlags` with the value following `flag` replaced by `value`. */
function withFlag(flag: string, value: string): string[] {
const flags = [...validFlags];
const index = flags.indexOf(flag);
flags[index + 1] = value;
return flags;
}
/** Returns a copy of `validFlags` with `flag` (and its value) removed entirely. */
function withoutFlag(flag: string): string[] {
const flags = [...validFlags];
const index = flags.indexOf(flag);
flags.splice(index, 2);
return flags;
}
describe("parseOptions", async () => {
await it("parses valid flags", () => {
const options = parseOptions(validFlags);
assert.deepEqual(options, {
body: "hello",
marker: "marker",
updateOnly: false,
issueId: 42,
repository: { owner: "github", repo: "codeql-action" },
});
});
await it("enables update-only mode when --update-only is supplied", () => {
const options = parseOptions([...validFlags, "--update-only"]);
assert.equal(options.updateOnly, true);
});
await it("rejects a missing --body", () => {
assert.throws(
() => parseOptions(withoutFlag("--body")),
/Missing required flag --body/,
);
});
await it("rejects an empty --body", () => {
assert.throws(
() => parseOptions(withFlag("--body", "")),
/The value for --body cannot be empty/,
);
});
await it("rejects a whitespace-only --body", () => {
assert.throws(
() => parseOptions(withFlag("--body", " \t\n")),
/The value for --body cannot be empty/,
);
});
await it("rejects a missing --marker", () => {
assert.throws(
() => parseOptions(withoutFlag("--marker")),
/Missing required flag --marker/,
);
});
await it("rejects an empty --marker", () => {
assert.throws(
() => parseOptions(withFlag("--marker", "")),
/The value for --marker cannot be empty/,
);
});
await it("rejects a whitespace-only --marker", () => {
assert.throws(
() => parseOptions(withFlag("--marker", " \t\n")),
/The value for --marker cannot be empty/,
);
});
await it("rejects a missing --repository", () => {
assert.throws(
() => parseOptions(withoutFlag("--repository")),
/Missing required flag --repository/,
);
});
await it("rejects an empty --repository", () => {
assert.throws(
() => parseOptions(withFlag("--repository", "")),
/The value for --repository cannot be empty/,
);
});
await it("rejects a whitespace-only --repository", () => {
assert.throws(
() => parseOptions(withFlag("--repository", " \t\n")),
/The value for --repository cannot be empty/,
);
});
await it("rejects an invalid --repository value", () => {
assert.throws(
() => parseOptions(withFlag("--repository", "github/codeql/action")),
/Invalid --repository value/,
);
});
});
describe("resolveToken", async () => {
await it("reads the token from GH_TOKEN", () => {
assert.equal(
resolveToken({ GH_TOKEN: "gh-token", GITHUB_TOKEN: "gha-token" }),
"gh-token",
);
});
await it("falls back to GITHUB_TOKEN", () => {
assert.equal(resolveToken({ GITHUB_TOKEN: "gha-token" }), "gha-token");
});
await it("throws when no token is set", () => {
assert.throws(() => resolveToken({}), /Missing authentication token/);
});
});
/** A minimal fake of the subset of `ApiClient` used by post-comment.ts. */
function fakeClient(existingComments: Array<{ id: number; body?: string }>) {
const comments = existingComments.map((comment) => ({ ...comment }));
let nextId =
comments.reduce((maxId, comment) => Math.max(maxId, comment.id), 0) + 1;
const client = {
paginate: async () => comments,
rest: {
issues: {
listComments: () => {},
createComment: async ({ body }: { body: string }) => {
comments.push({ id: nextId++, body });
},
updateComment: async ({
comment_id,
body,
}: {
comment_id: number;
body: string;
}) => {
const comment = comments.find(({ id }) => id === comment_id);
assert.ok(comment, `Comment ${comment_id} does not exist.`);
comment.body = body;
},
},
},
};
return { client: client as unknown as ApiClient, comments };
}
describe("findExistingComment", async () => {
await it("finds the id of the first comment containing the marker", async () => {
const { client } = fakeClient([
{ id: 1, body: "unrelated" },
{ id: 2, body: "<!-- marker -->\nhello" },
{ id: 3, body: "<!-- marker -->\nanother" },
]);
const id = await findExistingComment(
client,
{ owner: "owner", repo: "repo" },
1,
"marker",
);
assert.equal(id, 3);
});
await it("returns undefined when no comment matches", async () => {
const { client } = fakeClient([{ id: 1, body: "unrelated" }]);
const id = await findExistingComment(
client,
{ owner: "owner", repo: "repo" },
1,
"marker",
);
assert.equal(id, undefined);
});
});
/** A baseline set of `Options`, for use in `setComment` tests. */
const baseOptions: Options = {
body: "hello",
marker: "marker",
updateOnly: false,
issueId: 42,
repository: { owner: "owner", repo: "repo" },
};
function assertCommentContent(
comment: { body?: string },
marker: string,
body: string,
): void {
assert.ok(comment.body?.startsWith(`<!-- ${marker} -->`));
assert.ok(comment.body?.endsWith(body));
}
describe("setComment", async () => {
await it("does not create a comment in update-only mode when none exists", async () => {
const { client, comments } = fakeClient([]);
await setComment(client, { ...baseOptions, updateOnly: true });
// Resolution does not introduce a warning that was never posted.
assert.deepEqual(comments, []);
});
await it("leaves unrelated comments unchanged in update-only mode", async () => {
const originalComments = [{ id: 7, body: "unrelated" }];
const { client, comments } = fakeClient(originalComments);
await setComment(client, { ...baseOptions, updateOnly: true });
// Unrelated comments neither trigger resolution nor get overwritten.
assert.deepEqual(comments, originalComments);
});
await it("uses the supplied marker without affecting other comments", async () => {
const marker = "custom-warning";
const { client, comments } = fakeClient([
{ id: 1, body: "<!-- marker -->\nunrelated warning" },
{ id: 2, body: "<!-- custom-warning -->\nold warning" },
]);
const options = parseOptions(withFlag("--marker", marker));
await setComment(client, options);
// Only the comment with the supplied marker changes.
assert.equal(comments.length, 2);
assert.deepEqual(comments[0], {
id: 1,
body: "<!-- marker -->\nunrelated warning",
});
assert.equal(comments[1].id, 2);
assertCommentContent(comments[1], marker, options.body);
});
await it("creates a new comment with the marker prepended", async () => {
const { client, comments } = fakeClient([]);
// No comment has the marker before posting.
assert.equal(comments.length, 0);
assert.ok(
!comments.some(({ body }) => body?.startsWith("<!-- marker -->")),
);
await setComment(client, baseOptions);
// Posting adds exactly one comment with the marker before the body.
assert.equal(comments.length, 1);
assertCommentContent(comments[0], baseOptions.marker, baseOptions.body);
});
await it("creates a new comment when no existing comment matches", async () => {
const originalComments = [
{ id: 7, body: "unrelated" },
{ id: 2, body: "another unrelated comment" },
];
const { client, comments } = fakeClient(originalComments);
// Existing comments do not match the marker.
assert.ok(
!comments.some(({ body }) => body?.startsWith("<!-- marker -->")),
);
await setComment(client, baseOptions);
// A new comment is added without changing unrelated comments.
assert.equal(comments.length, originalComments.length + 1);
assert.deepEqual(
comments.slice(0, originalComments.length),
originalComments,
);
const markedComments = comments.filter(({ body }) =>
body?.startsWith("<!-- marker -->"),
);
// Exactly one comment contains the expected marker and body.
assert.equal(markedComments.length, 1);
assertCommentContent(
markedComments[0],
baseOptions.marker,
baseOptions.body,
);
// The new comment's ID does not collide with existing IDs.
assert.equal(new Set(comments.map(({ id }) => id)).size, comments.length);
});
await it("updates the existing comment when one is found", async () => {
const { client, comments } = fakeClient([
{ id: 7, body: "<!-- marker -->\nold" },
]);
await setComment(client, baseOptions);
// Updating preserves the comment's ID without creating a duplicate.
assert.equal(comments.length, 1);
assert.equal(comments[0].id, 7);
assertCommentContent(comments[0], baseOptions.marker, baseOptions.body);
});
await it("replaces a warning with the resolved state using the same marker", async () => {
const { client, comments } = fakeClient([
{ id: 9, body: "<!-- marker -->\nold" },
]);
const body =
"`CHANGELOG.md` is not modified in this PR. No changelog action is needed.";
await setComment(client, { ...baseOptions, body, updateOnly: true });
// The resolved state replaces the warning on the same marked comment.
assert.equal(comments.length, 1);
assert.equal(comments[0].id, 9);
assertCommentContent(comments[0], baseOptions.marker, body);
});
});
+180
View File
@@ -0,0 +1,180 @@
#!/usr/bin/env npx tsx
/*
Creates or updates a pull-request comment identified by a marker.
The marker is supplied via `--marker` and must be a non-empty plain-text identifier.
The CLI wraps the marker in a hidden HTML comment, prepends it to `--body`,
and uses it to find the comment on later runs.
Supply `--update-only` to suppress creation of comment; omit it
to update or create comments.
Example:
```sh
GH_TOKEN=<token> npx tsx ./pr-checks/post-comment.ts \
--body "The changelog needs updating." \
--marker "my-bot" \
--issue-id 123 \
--repository github/codeql-action
```
*/
import assert from "node:assert/strict";
import { parseArgs } from "node:util";
import { parseRepositoryNwo, type RepositoryNwo } from "../src/repository";
import { type ApiClient, getApiClient, resolveToken } from "./api-client";
/** Represents the command-line options. */
export interface Options {
/** The full comment body. */
body: string;
/** Plain-text identifier wrapped in a hidden HTML comment. */
marker: string;
/** Whether to only update a comment if a matching marker exists. */
updateOnly: boolean;
/** The issue/pull request number to post/update the comment on. */
issueId: number;
/** The repository to operate on. */
repository: RepositoryNwo;
}
function hiddenMarker(marker: string): string {
return `<!-- ${marker} -->`;
}
/** Parses CLI arguments supplied by the composite action into `Options`. */
export function parseOptions(argv?: string[]): Options {
const { values } = parseArgs({
args: argv,
options: {
body: { type: "string" },
marker: { type: "string" },
"update-only": { type: "boolean", default: false },
"issue-id": { type: "string" },
repository: { type: "string" },
},
strict: true,
});
assert(values.body !== undefined, "Missing required flag --body.");
assert(values.body.trim() !== "", "The value for --body cannot be empty.");
assert(values.marker !== undefined, "Missing required flag --marker.");
assert(
values.marker.trim() !== "",
"The value for --marker cannot be empty.",
);
assert(
values.repository !== undefined,
"Missing required flag --repository.",
);
assert(
values.repository.trim() !== "",
"The value for --repository cannot be empty.",
);
assert(
/^[\w.-]+\/[\w.-]+$/.test(values.repository),
"Invalid --repository value.",
);
return {
body: values.body,
marker: values.marker,
updateOnly: values["update-only"],
issueId: Number(values["issue-id"]),
repository: parseRepositoryNwo(values.repository),
};
}
/**
* Finds the first comment on the given issue/pull request whose body starts with `marker`, if any.
*/
export async function findExistingComment(
client: ApiClient,
repository: RepositoryNwo,
issueNumber: number,
marker: string,
): Promise<number | undefined> {
const formattedMarker = hiddenMarker(marker);
const comments = await client.paginate(client.rest.issues.listComments, {
...repository,
issue_number: issueNumber,
per_page: 100,
});
const markedComments = comments.filter((comment) =>
comment.body?.startsWith(formattedMarker),
);
if (markedComments.length > 1) {
console.warn(
`Found ${markedComments.length} comments with marker "${formattedMarker}". ` +
"Updating the first one and leaving the others unchanged. " +
"Use a unique marker for each distinct managed comment to avoid this situation.",
);
}
return markedComments.at(-1)?.id;
}
/**
* Creates or updates a marked comment using `client` to talk to the GitHub API.
*/
export async function setComment(
client: ApiClient,
options: Options,
): Promise<void> {
const { issueId, marker, repository } = options;
const body = `${hiddenMarker(marker)}\n${options.body}`;
const existingCommentId = await findExistingComment(
client,
repository,
issueId,
marker,
);
if (existingCommentId === undefined) {
if (options.updateOnly) {
console.info(
"No existing comment found; skipping creation because --update-only was specified.",
);
return;
}
console.info("No existing comment found; creating a new comment.");
await client.rest.issues.createComment({
...repository,
issue_number: issueId,
body,
});
} else {
console.info(`Updating existing comment ${existingCommentId}.`);
await client.rest.issues.updateComment({
...repository,
comment_id: existingCommentId,
body,
});
}
}
async function main(): Promise<number> {
const options = parseOptions();
const token = resolveToken(process.env);
const client = getApiClient(token);
await setComment(client, options);
return 0;
}
async function run(): Promise<void> {
try {
process.exit(await main());
} catch (err) {
console.error(err instanceof Error ? err.message : String(err));
process.exit(1);
}
}
if (import.meta.main) {
void run();
}
+1 -1
View File
@@ -6,7 +6,7 @@ to one of the files in this directory.
## Updating workflows
Run `./sync.sh` to invoke the workflow generator and re-generate the workflow files in `.github/workflows/` based on the templates in `pr-checks/checks/`.
Run `./sync.sh` to invoke the workflow generator and re-generate the workflow files in `.github/workflows/` based on the templates in `pr-checks/checks/`. This also updates the list of workflows whose failed jobs `.github/workflows/deflake.yml` reruns.
Alternatively, you can use `just`:
+12 -6
View File
@@ -8,6 +8,7 @@ import * as yaml from "yaml";
import { BuiltInLanguage } from "../src/languages";
import { PR_CHECKS_DIR, REPO_ROOT } from "./config";
import { updateDeflakeWorkflow } from "./deflake";
/**
* Returns a `uses` value for `action` pinned to a commit SHA, with the
@@ -265,8 +266,8 @@ const languageSetups: LanguageSetups = {
name: "Install Go",
uses: pinnedUses(
"actions/setup-go",
"b7ad1dad31e06c5925ef5d2fc7ad053ef454303e",
"v7.0.0",
"d8cbb8045d7f43706b9177cceb36c1f91a6644d5",
"v7.1.0",
),
with: {
"go-version": `\${{ inputs.go-version || '${defaultLanguageVersions.go}' }}`,
@@ -285,8 +286,8 @@ const languageSetups: LanguageSetups = {
name: "Install Java",
uses: pinnedUses(
"actions/setup-java",
"b843ebf9b913146b38da2eaa7aeddf76074ae1ad",
"v6.1.0",
"d1374f8ac74474200d16ef8ecee22c7ae7a51880",
"v6.3.0",
),
with: {
"java-version": `\${{ inputs.java-version || '${defaultLanguageVersions.java}' }}`,
@@ -320,8 +321,8 @@ const languageSetups: LanguageSetups = {
name: "Install .NET",
uses: pinnedUses(
"actions/setup-dotnet",
"a98b56852c35b8e3190ac28c8c2271da59106c68",
"v6.0.0",
"0f4a354dd5547a28c70b7853dbd95d5b67886e73",
"v6.1.0",
),
with: {
"dotnet-version": `\${{ inputs.dotnet-version || '${defaultLanguageVersions.csharp}' }}`,
@@ -747,6 +748,7 @@ function main(): void {
console.log(`Found ${checkFiles.length} check specification(s).`);
const generatedWorkflowNames: string[] = [];
const collections: Record<
string,
Array<{
@@ -834,6 +836,7 @@ function main(): void {
const outputPath = path.join(OUTPUT_DIR, `__${checkName}.yml`);
writeYaml(outputPath, workflow);
generatedWorkflowNames.push(workflow.name);
}
// Write workflow files for collections.
@@ -878,8 +881,11 @@ function main(): void {
const outputPath = path.join(OUTPUT_DIR, `__${collectionName}.yml`);
writeYaml(outputPath, collectionWorkflow);
generatedWorkflowNames.push(collectionWorkflow.name);
}
updateDeflakeWorkflow(generatedWorkflowNames);
console.log(
`\nDone. Wrote ${checkFiles.length} workflow file(s) to ${OUTPUT_DIR}`,
);
+1 -1
View File
@@ -1 +1 @@
{"maximumVersion":"3.23","minimumVersion":"3.19"}
{"maximumVersion":"3.24","minimumVersion":"3.19"}
+4 -4
View File
@@ -1,6 +1,6 @@
{
"bundleVersion": "codeql-bundle-v2.27.4",
"cliVersion": "2.27.4",
"priorBundleVersion": "codeql-bundle-v2.27.3",
"priorCliVersion": "2.27.3"
"bundleVersion": "codeql-bundle-v2.27.6",
"cliVersion": "2.27.6",
"priorBundleVersion": "codeql-bundle-v2.27.5",
"priorCliVersion": "2.27.5"
}
+5 -5
View File
@@ -541,7 +541,7 @@ async function recordOverlayStatus(
// one if a CodeQL Action reported an error before the job ended.
if (!isConclusiveJobStatus(jobStatus) && !didCodeQlReportError(env)) {
logger.info(
"Not recording an improved incremental analysis failure for this job because the job " +
"Not recording an overlay analysis failure for this job because the job " +
`status (${jobStatus ?? "unset"}) does not tell us whether the analysis itself failed.`,
);
return;
@@ -576,15 +576,15 @@ async function recordOverlayStatus(
);
const blurb =
"This job attempted to run with improved incremental analysis but it did not complete successfully. " +
"One possible reason for this is disk space constraints, since improved incremental analysis can " +
"This job attempted to run with overlay analysis but it did not complete successfully. " +
"One possible reason for this is disk space constraints, since overlay analysis can " +
"require a significant amount of disk space for some repositories.";
if (saved) {
logger.error(
`${blurb} ` +
"This failure has been recorded in the Actions cache, so the next CodeQL analysis will run " +
"without improved incremental analysis. If you want to enable improved incremental analysis, " +
"without overlay analysis. If you want to enable overlay analysis, " +
"try increasing the disk space available to the runner. " +
"If that doesn't help, contact GitHub Support for further assistance.",
);
@@ -592,7 +592,7 @@ async function recordOverlayStatus(
logger.error(
`${blurb} ` +
"The attempt to save this failure status to the Actions cache failed. The Action will attempt to " +
"run with improved incremental analysis again.",
"run with overlay analysis again.",
);
}
}
+68
View File
@@ -0,0 +1,68 @@
import test from "ava";
import { EnvVar } from "./environment";
import { GitHubVariant, type GitHubVersion } from "./github";
import { getFinalJobStatus } from "./init-action-post";
import { JobStatus } from "./status-report";
import { callee, createTestConfig, setupTests } from "./testing-utils";
setupTests(test);
const dotcom: GitHubVersion = { type: GitHubVariant.DOTCOM };
test("getFinalJobStatus reports a cancelled job status when the job was cancelled after init completed", async (t) => {
await callee(getFinalJobStatus)
.withArgs(createTestConfig({}), "cancelled", dotcom)
.passes(t.is, JobStatus.CancelledStatus);
});
test("getFinalJobStatus reports a cancelled job status when the job was cancelled before init completed", async (t) => {
await callee(getFinalJobStatus)
.withArgs(undefined, "cancelled", dotcom)
.passes(t.is, JobStatus.CancelledStatus);
});
test("getFinalJobStatus reports a cancelled job status on GitHub Enterprise Cloud with data residency", async (t) => {
await callee(getFinalJobStatus)
.withArgs(createTestConfig({}), "cancelled", {
type: GitHubVariant.GHEC_DR,
})
.passes(t.is, JobStatus.CancelledStatus);
});
test("getFinalJobStatus reports success when the job was cancelled after analyze completed", async (t) => {
await callee(getFinalJobStatus)
.withEnv((env) => {
env.set(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
})
.withArgs(createTestConfig({}), "cancelled", dotcom)
.passes(t.is, JobStatus.SuccessStatus);
});
test("getFinalJobStatus reports the error from a CodeQL Action step when the job was cancelled afterwards", async (t) => {
await callee(getFinalJobStatus)
.withEnv((env) => {
env.set(EnvVar.JOB_STATUS, JobStatus.FailureStatus);
})
.withArgs(createTestConfig({}), "cancelled", dotcom)
.passes(t.is, JobStatus.FailureStatus);
});
test("getFinalJobStatus reports a configuration error when a step outside the CodeQL Action failed", async (t) => {
await callee(getFinalJobStatus)
.withArgs(createTestConfig({}), "failure", dotcom)
.passes(t.is, JobStatus.ConfigErrorStatus);
});
test("getFinalJobStatus doesn't report a cancelled job status on GitHub Enterprise Server", async (t) => {
const ghes: GitHubVersion = {
type: GitHubVariant.GHES,
version: "3.23.0",
};
await callee(getFinalJobStatus)
.withArgs(createTestConfig({}), "cancelled", ghes)
.passes(t.is, JobStatus.ConfigErrorStatus);
await callee(getFinalJobStatus)
.withArgs(undefined, "cancelled", ghes)
.passes(t.is, JobStatus.UnknownStatus);
});
+37 -11
View File
@@ -30,6 +30,7 @@ import {
import { EnvVar, type ReadOnlyEnv } from "./environment";
import { initFeatures } from "./feature-flags";
import * as gitUtils from "./git-utils";
import type { GitHubVersion } from "./github";
import * as initActionPostHelper from "./init-action-post-helper";
import { getRepositoryNwo } from "./repository";
import {
@@ -40,6 +41,7 @@ import {
ActionName,
getJobStatusDisplayName,
JobStatus,
supportsCancelledJobStatus,
} from "./status-report";
import { checkDiskUsage, checkGitHubVersionInRange, wrapError } from "./util";
@@ -55,7 +57,9 @@ async function run(action: ActionState<["Base", "Logger", "Env"]>) {
// possible, and only use safe functions outside.
const logger = action.logger;
let actionsJobStatus: string | undefined;
let config: Config | AbortedInitConfig | undefined;
let gitHubVersion: GitHubVersion;
let uploadFailedSarifResult:
initActionPostHelper.UploadFailedSarifResult | undefined;
let dependencyCachingUsage: DependencyCachingUsageReport | undefined;
@@ -64,7 +68,7 @@ async function run(action: ActionState<["Base", "Logger", "Env"]>) {
// Read the job status before restoring inputs, since it is provided by the Actions runtime
// environment for this step and would otherwise be overwritten by the value that the `init`
// Action saw, which is always a success.
const jobStatus = getOptionalInput("job-status");
actionsJobStatus = getOptionalInput("job-status");
// Restore inputs from `init` Action.
restoreInputs(logger);
@@ -82,7 +86,7 @@ async function run(action: ActionState<["Base", "Logger", "Env"]>) {
config = getAbortedInitConfig(action, tmpDir);
}
const gitHubVersion = config?.gitHubVersion ?? (await getGitHubVersion());
gitHubVersion = config?.gitHubVersion ?? (await getGitHubVersion());
checkGitHubVersionInRange(gitHubVersion, logger);
const repositoryNwo = getRepositoryNwo();
@@ -107,7 +111,7 @@ async function run(action: ActionState<["Base", "Logger", "Env"]>) {
config,
repositoryNwo,
features,
jobStatus,
actionsJobStatus,
action.env,
logger,
);
@@ -146,7 +150,12 @@ async function run(action: ActionState<["Base", "Logger", "Env"]>) {
}
return;
}
const jobStatus = getFinalJobStatus(action, config);
const jobStatus = getFinalJobStatus(
action,
config,
actionsJobStatus,
gitHubVersion,
);
logger.info(`CodeQL job status was ${getJobStatusDisplayName(jobStatus)}.`);
const statusReportBase = await createStatusReportBase(
@@ -175,11 +184,21 @@ async function run(action: ActionState<["Base", "Logger", "Env"]>) {
*
* If the job status has already been set by another step, we use that.
* Otherwise, we determine the job status based on whether the analyze step
* completed successfully and whether we have a valid CodeQL config.
* completed successfully, whether the job was cancelled, and whether we have a
* valid CodeQL config.
*
* Exported for testing.
*
* @param actionsJobStatus The status of the job, as reported by the Actions
* runtime environment.
* @param gitHubVersion The version of the GitHub instance that the status
* report is sent to.
*/
function getFinalJobStatus(
export function getFinalJobStatus(
action: ActionState<["Env"]>,
config: Partial<Config> | undefined,
actionsJobStatus: string | undefined,
gitHubVersion: GitHubVersion,
): JobStatus {
const existingJobStatus = getJobStatusFromEnvironment(action.env);
if (existingJobStatus !== undefined) {
@@ -193,21 +212,28 @@ function getFinalJobStatus(
) {
action.env.export(EnvVar.JOB_STATUS, JobStatus.SuccessStatus);
jobStatus = JobStatus.SuccessStatus;
} else if (
actionsJobStatus === "cancelled" &&
supportsCancelledJobStatus(gitHubVersion)
) {
// The job was cancelled before the analysis completed, and no CodeQL
// Action step reported an error.
jobStatus = JobStatus.CancelledStatus;
} else if (config !== undefined) {
// - We have computed a CodeQL config
// - Analyze didn't complete successfully
// - The job status hasn't already been set to Failure/ConfigurationError
//
// This means that something along the way failed in a step that is not
// owned by the Action, for example a manual build step. We consider this a
// configuration error.
// owned by the Action, for example a manual build step, or that the job
// was cancelled and the GitHub instance isn't known to accept
// `JobStatus.CancelledStatus`. We consider this a configuration error.
jobStatus = JobStatus.ConfigErrorStatus;
} else {
// If we didn't manage to compute a CodeQL config, it is unclear at this
// point why the analyze Action didn't complete.
// - One possibility is that the workflow run was cancelled. We could
// consider determining workflow cancellation using the GitHub API, but
// for now we treat all these cases as unknown.
// - One possibility is that the job was cancelled and the GitHub instance
// isn't known to accept `JobStatus.CancelledStatus`.
// - Another possibility is that we're running a workflow that only runs
// `init`, for instance a workflow that was created before `setup-codeql`
// was available and uses `init` just to set up the CodeQL tools.
+8 -8
View File
@@ -84,18 +84,18 @@ export async function addOverlayDisablementDiagnostics(
config,
makeDiagnostic(
"codeql-action/overlay-disabled-due-to-cached-status",
"Skipped improved incremental analysis because it failed previously with similar hardware resources",
"Skipped overlay analysis because it failed previously with similar hardware resources",
{
attributes: {
languages: config.languages,
},
markdownMessage:
`Improved incremental analysis was skipped because it previously failed for this repository ` +
`Overlay analysis was skipped because it previously failed for this repository ` +
`with CodeQL version ${(await codeql.getVersion()).version} on a runner with similar hardware resources. ` +
"One possible reason for this is that improved incremental analysis can require a significant amount of disk space for some repositories. " +
"If you want to try re-enabling improved incremental analysis, increase the disk space available " +
"One possible reason for this is that overlay analysis can require a significant amount of disk space for some repositories. " +
"If you want to try re-enabling overlay analysis, increase the disk space available " +
"to the runner. If that doesn't help, contact GitHub Support for further assistance.\n\n" +
"Improved incremental analysis will be automatically retried when the next version of CodeQL is released. " +
"Overlay analysis will be automatically retried when the next version of CodeQL is released. " +
`You can also manually trigger a retry by [removing](${DocUrl.DELETE_ACTIONS_CACHE_ENTRIES}) \`codeql-overlay-status-*\` entries from the Actions cache.`,
severity: "note",
visibility: {
@@ -115,15 +115,15 @@ export async function addOverlayDisablementDiagnostics(
config,
makeDiagnostic(
"codeql-action/overlay-disabled-by-repository-property",
"Improved incremental analysis disabled by repository property",
"Overlay analysis disabled by repository property",
{
attributes: {
languages: config.languages,
},
markdownMessage:
"Improved incremental analysis has been disabled because the " +
"Overlay analysis has been disabled because the " +
`\`${RepositoryPropertyName.DISABLE_OVERLAY}\` repository property is set to \`true\`. ` +
"To re-enable improved incremental analysis, set this property to `false` or remove it.",
"To re-enable overlay analysis, set this property to `false` or remove it.",
severity: "note",
visibility: {
cliSummaryTable: true,
+47 -6
View File
@@ -1821,7 +1821,8 @@ function createToolcacheEntry(
/**
* Stubs out the download and the diagnostic sink, then downloads the CodeQL tools.
*
* @returns the extraction directory and the toolcache cleanup diagnostic, if emitted.
* @returns the extraction directory and, if the toolcache cleanup diagnostic was emitted, the
* cleanup duration it reports and its other attributes.
*/
async function runDownloadCodeQL(
toolcacheRoot: string,
@@ -1837,6 +1838,7 @@ async function runDownloadCodeQL(
): Promise<{
codeqlFolder: string;
cleanupDiagnostic: toolsDownload.ToolcacheCleanupResult | undefined;
cleanupDurationMs: number | undefined;
}> {
stubDownloadAndExtract();
const addDiagnostic = sinon.stub(diagnostics, "addNoLanguageDiagnostic");
@@ -1866,11 +1868,21 @@ async function runDownloadCodeQL(
.map((call) => call.args[1])
.find((d) => d.source?.id === "codeql-action/toolcache-bundle-cleanup");
return {
codeqlFolder,
cleanupDiagnostic: diagnostic?.attributes as
toolsDownload.ToolcacheCleanupResult | undefined,
};
if (diagnostic === undefined) {
return {
codeqlFolder,
cleanupDiagnostic: undefined,
cleanupDurationMs: undefined,
};
}
// The duration varies between runs, so split it out to let tests compare the other attributes
// exactly.
const { durationMs, ...cleanupDiagnostic } =
diagnostic.attributes as toolsDownload.ToolcacheCleanupResult & {
durationMs: number;
};
return { codeqlFolder, cleanupDiagnostic, cleanupDurationMs: durationMs };
}
/**
@@ -1991,6 +2003,35 @@ test.serial(
},
);
test.serial(
"downloadCodeQLBundle reports the total time taken to clean up the toolcache",
async (t) => {
await withTmpDir(async (tmpDir) => {
setupActionsVars(tmpDir, tmpDir);
createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_CLI_VERSION);
createToolcacheEntry(tmpDir, "CodeQL", CLEANUP_STALE_VERSION);
// Advance the clock by 1.5s each time a path is deleted, so that deleting both versions
// takes 3s.
let elapsedMs = 1000;
sinon.stub(performance, "now").callsFake(() => elapsedMs);
const rm = fs.promises.rm;
sinon.stub(fs.promises, "rm").callsFake(async (...args) => {
elapsedMs += 1500;
await rm(...args);
});
const { cleanupDurationMs } = await runDownloadCodeQL(
tmpDir,
CLEANUP_BUNDLE_VERSION,
);
t.is(cleanupDurationMs, 3000);
});
},
);
test.serial(
"downloadCodeQLBundle reports no deleted versions when the toolcache has no CodeQL bundles",
async (t) => {
+2 -1
View File
@@ -814,6 +814,7 @@ async function tryDeleteToolcacheBundles({
return;
}
const startTime = performance.now();
const result = await deleteToolcacheBundles({ env, logger });
addNoLanguageDiagnostic(
@@ -821,7 +822,7 @@ async function tryDeleteToolcacheBundles({
makeTelemetryDiagnostic(
"codeql-action/toolcache-bundle-cleanup",
"Toolcache CodeQL bundle cleanup",
{ ...result },
{ ...result, durationMs: util.durationMsSince(startTime) },
),
);
}
+19 -1
View File
@@ -31,7 +31,7 @@ import {
exportEnvVar,
} from "./environment";
import { getRef } from "./git-utils";
import { GITHUB_DOTCOM_URL } from "./github";
import { GITHUB_DOTCOM_URL, GitHubVariant, type GitHubVersion } from "./github";
import * as json from "./json";
import type { Logger } from "./logging";
import type { OverlayBaseDatabaseDownloadStats } from "./overlay/caching";
@@ -137,6 +137,22 @@ export enum JobStatus {
SuccessStatus = "JOB_STATUS_SUCCESS",
FailureStatus = "JOB_STATUS_FAILURE",
ConfigErrorStatus = "JOB_STATUS_CONFIGURATION_ERROR",
/** The job was cancelled before the analysis completed. */
CancelledStatus = "JOB_STATUS_CANCELLED",
}
/**
* Whether the status report API of the GitHub instance is known to accept
* `JobStatus.CancelledStatus`. The API rejects status reports with a job status
* that it doesn't recognise.
*/
export function supportsCancelledJobStatus(
gitHubVersion: GitHubVersion,
): boolean {
return (
gitHubVersion.type === GitHubVariant.DOTCOM ||
gitHubVersion.type === GitHubVariant.GHEC_DR
);
}
export interface StatusReportBase {
@@ -268,6 +284,8 @@ export function getJobStatusDisplayName(status: JobStatus): string {
return "configuration error";
case JobStatus.UnknownStatus:
return "unknown";
case JobStatus.CancelledStatus:
return "cancelled";
default:
assertNever(status);
}
+4 -1
View File
@@ -342,13 +342,16 @@ export async function deleteToolcacheBundles({
const versionDirectory = path.join(toolDirectory, entry.name);
try {
const deletionStart = performance.now();
await fs.promises.rm(versionDirectory, {
force: true,
recursive: true,
});
deletedVersions.push(entry.name);
logger.info(
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space.`,
`Deleted the CodeQL tools at '${versionDirectory}' from the toolcache to free up disk space (${formatDuration(
durationMsSince(deletionStart),
)}).`,
);
} catch (e) {
failed = true;
@@ -1 +0,0 @@
- Fixed diff-informed alert filtering incorrectly removing alerts in changed files whose paths contain spaces, special characters, or non-ASCII characters. [#4283](https://github.com/github/codeql-action/pull/4283)