Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: github/codeql-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.25.8
Choose a base ref
...
head repository: github/codeql-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.25.9
Choose a head ref

Commits on May 29, 2024

  1. Update supported GitHub Enterprise Server versions

    github-actions[bot] committed May 29, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    df52537 View commit details

Commits on Jun 4, 2024

  1. Update changelog and version after v3.25.8

    github-actions[bot] committed Jun 4, 2024
    Copy the full SHA
    25cffc6 View commit details
  2. Update checked-in dependencies

    github-actions[bot] committed Jun 4, 2024
    Copy the full SHA
    c481707 View commit details
  3. Merge pull request #2324 from github/mergeback/v3.25.8-to-main-2e230e8f

    Mergeback v3.25.8 refs/heads/releases/v3 into main
    cklin authored Jun 4, 2024
    Copy the full SHA
    8f1a6fe View commit details

Commits on Jun 10, 2024

  1. Bump the npm group with 5 updates

    Bumps the npm group with 5 updates:
    
    | Package | From | To |
    | --- | --- | --- |
    | [adm-zip](https://github.com/cthackers/adm-zip) | `0.5.13` | `0.5.14` |
    | [uuid](https://github.com/uuidjs/uuid) | `9.0.1` | `10.0.0` |
    | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `7.12.0` | `7.13.0` |
    | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `7.12.0` | `7.13.0` |
    | [eslint-plugin-github](https://github.com/github/eslint-plugin-github) | `5.0.0` | `5.0.1` |
    
    
    Updates `adm-zip` from 0.5.13 to 0.5.14
    - [Release notes](https://github.com/cthackers/adm-zip/releases)
    - [Changelog](https://github.com/cthackers/adm-zip/blob/master/history.md)
    - [Commits](cthackers/adm-zip@v0.5.13...v0.5.14)
    
    Updates `uuid` from 9.0.1 to 10.0.0
    - [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
    - [Commits](uuidjs/uuid@v9.0.1...v10.0.0)
    
    Updates `@typescript-eslint/eslint-plugin` from 7.12.0 to 7.13.0
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.0/packages/eslint-plugin)
    
    Updates `@typescript-eslint/parser` from 7.12.0 to 7.13.0
    - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
    - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
    - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.0/packages/parser)
    
    Updates `eslint-plugin-github` from 5.0.0 to 5.0.1
    - [Release notes](https://github.com/github/eslint-plugin-github/releases)
    - [Commits](github/eslint-plugin-github@v5.0.0...v5.0.1)
    
    ---
    updated-dependencies:
    - dependency-name: adm-zip
      dependency-type: direct:production
      update-type: version-update:semver-patch
      dependency-group: npm
    - dependency-name: uuid
      dependency-type: direct:production
      update-type: version-update:semver-major
      dependency-group: npm
    - dependency-name: "@typescript-eslint/eslint-plugin"
      dependency-type: direct:development
      update-type: version-update:semver-minor
      dependency-group: npm
    - dependency-name: "@typescript-eslint/parser"
      dependency-type: direct:development
      update-type: version-update:semver-minor
      dependency-group: npm
    - dependency-name: eslint-plugin-github
      dependency-type: direct:development
      update-type: version-update:semver-patch
      dependency-group: npm
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jun 10, 2024
    Copy the full SHA
    c65a150 View commit details

Commits on Jun 11, 2024

  1. Merge branch 'main' into update-supported-enterprise-server-versions

    henrymercer authored Jun 11, 2024
    Copy the full SHA
    358d5e7 View commit details
  2. Copy the full SHA
    2838ced View commit details
  3. Try installing npm without sudo

    henrymercer committed Jun 11, 2024
    Copy the full SHA
    b411f9b View commit details
  4. Merge pull request #2315 from github/update-supported-enterprise-serv…

    …er-versions
    
    Update supported GitHub Enterprise Server versions
    henrymercer authored Jun 11, 2024
    Copy the full SHA
    c796494 View commit details
  5. Use --force-overwrite for creating databases

    ...but only if the feature exists in the CLI.
    aeisenberg committed Jun 11, 2024
    Copy the full SHA
    0a64ae0 View commit details
  6. Update changelog

    aeisenberg committed Jun 11, 2024
    Copy the full SHA
    b808216 View commit details
  7. Fix formatting

    aeisenberg committed Jun 11, 2024
    Copy the full SHA
    2fc7222 View commit details
  8. Fix typo

    aeisenberg committed Jun 11, 2024
    Copy the full SHA
    eb1d92b View commit details
  9. Merge pull request #2330 from github/aeisenberg/force-overwrite

    Use `--force-overwrite` for creating databases
    aeisenberg authored Jun 11, 2024
    Copy the full SHA
    81b8143 View commit details

Commits on Jun 12, 2024

  1. Fix bash syntax

    This should stop
    
        .github/workflows/script/update-node-modules.sh: line 1: [: missing `]'
    igfoo committed Jun 12, 2024
    Copy the full SHA
    b0944a2 View commit details
  2. Merge branch 'main' into dependabot/npm_and_yarn/npm-8402b9d28a

    nickfyson authored Jun 12, 2024
    Copy the full SHA
    ca3043e View commit details
  3. Attempt to clean up the database cluster directory

    This will help to avoid issues where the database cluster directory is left in an inconsistent state.
    henrymercer committed Jun 12, 2024
    Copy the full SHA
    1354fe5 View commit details
  4. Add PR check for cleaning up database cluster dir

    henrymercer committed Jun 12, 2024
    Copy the full SHA
    c8fb403 View commit details
  5. Update checked-in dependencies

    github-actions[bot] committed Jun 12, 2024
    Copy the full SHA
    9ee83fa View commit details
  6. Merge pull request #2331 from github/igfoo/bash

    Fix bash syntax
    igfoo authored Jun 12, 2024
    Copy the full SHA
    945bb87 View commit details
  7. Include underlying error in error message

    henrymercer committed Jun 12, 2024
    Copy the full SHA
    3d849e9 View commit details
  8. Clean up DB cluster directory at the end of each job

    henrymercer committed Jun 12, 2024
    Copy the full SHA
    d8d73c0 View commit details
  9. Merge pull request #2326 from github/dependabot/npm_and_yarn/npm-8402…

    …b9d28a
    
    Bump the npm group with 5 updates
    henrymercer authored Jun 12, 2024
    Copy the full SHA
    31fe7dd View commit details
  10. Skip init-post cleanup on GitHub-hosted runners

    henrymercer committed Jun 12, 2024
    Copy the full SHA
    ed34eb9 View commit details
  11. Tweak changelog entries

    Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
    henrymercer and aeisenberg authored Jun 12, 2024
    Copy the full SHA
    159d911 View commit details
  12. Merge pull request #2332 from github/henrymercer/cleanup-db-location

    Attempt to clean up the database cluster directory
    henrymercer authored Jun 12, 2024
    Copy the full SHA
    37809d1 View commit details
  13. Update changelog for v3.25.9

    github-actions[bot] committed Jun 12, 2024
    Copy the full SHA
    65db484 View commit details
  14. Merge pull request #2334 from github/update-v3.25.9-37809d1f1

    Merge main into releases/v3
    henrymercer authored Jun 12, 2024
    Copy the full SHA
    530d4fe View commit details
Showing with 2,927 additions and 1,288 deletions.
  1. +81 −0 .github/workflows/__cleanup-db-cluster-dir.yml
  2. +5 −2 .github/workflows/script/update-node-modules.sh
  3. +5 −0 CHANGELOG.md
  4. +5 −1 lib/actions-util.js
  5. +1 −1 lib/actions-util.js.map
  6. +1 −1 lib/api-compatibility.json
  7. +4 −1 lib/codeql.js
  8. +1 −1 lib/codeql.js.map
  9. +18 −0 lib/init-action-post-helper.js
  10. +1 −1 lib/init-action-post-helper.js.map
  11. +1 −0 lib/init-action.js
  12. +1 −1 lib/init-action.js.map
  13. +38 −1 lib/init.js
  14. +1 −1 lib/init.js.map
  15. +83 −0 lib/init.test.js
  16. +1 −1 lib/init.test.js.map
  17. +1 −0 lib/tools-features.js
  18. +1 −1 lib/tools-features.js.map
  19. +52 −52 node_modules/.package-lock.json
  20. +1 −2 node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js
  21. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map
  22. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js
  23. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/disable-type-checked.js.map
  24. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.js
  25. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked-only.js.map
  26. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.js
  27. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict-type-checked.js.map
  28. +2 −6 node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js
  29. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map
  30. +9 −7 node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js
  31. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/class-literal-property-style.js.map
  32. +6 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js
  33. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/default-param-last.js.map
  34. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js
  35. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent.js.map
  36. +57 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js
  37. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/init-declarations.js.map
  38. +7 −0 node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js
  39. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map
  40. +2 −0 node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js
  41. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map
  42. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js
  43. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map
  44. +8 −40 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js
  45. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-dynamic-delete.js.map
  46. +8 −3 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js
  47. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map
  48. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implied-eval.js.map
  49. +1 −2 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js
  50. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map
  51. +32 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js
  52. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js.map
  53. +4 −3 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js
  54. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js.map
  55. +1 −4 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js
  56. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js.map
  57. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js.map
  58. +24 −9 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js
  59. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js.map
  60. +4 −4 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js
  61. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map
  62. +0 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js
  63. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map
  64. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js
  65. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map
  66. +3 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js
  67. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js.map
  68. +5 −0 node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js
  69. +1 −1 node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js.map
  70. +1 −1 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.mdx
  71. +6 −5 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.mdx
  72. +18 −20 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.mdx
  73. +41 −1 node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.mdx
  74. +5 −0 node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.mdx
  75. +1 −1 node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.mdx
  76. +6 −9 node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.mdx
  77. +12 −0 node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx
  78. +7 −9 node_modules/@typescript-eslint/eslint-plugin/package.json
  79. +1 −1 node_modules/@typescript-eslint/parser/dist/index.d.ts
  80. +1 −1 node_modules/@typescript-eslint/parser/dist/index.d.ts.map
  81. +2 −1 node_modules/@typescript-eslint/parser/dist/index.js
  82. +1 −1 node_modules/@typescript-eslint/parser/dist/index.js.map
  83. +5 −5 node_modules/@typescript-eslint/parser/package.json
  84. +1 −0 node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts
  85. +1 −1 node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map
  86. +3 −0 node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js
  87. +1 −1 node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map
  88. +4 −4 node_modules/@typescript-eslint/scope-manager/package.json
  89. +4 −4 node_modules/@typescript-eslint/type-utils/package.json
  90. +47 −8 node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts
  91. +1 −1 node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map
  92. +1 −1 node_modules/@typescript-eslint/types/package.json
  93. +1 −1 node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map
  94. +25 −3 node_modules/@typescript-eslint/typescript-estree/dist/convert.js
  95. +1 −1 node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map
  96. +1 −0 node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts
  97. +1 −1 node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts.map
  98. +3 −1 node_modules/@typescript-eslint/typescript-estree/dist/index.js
  99. +1 −1 node_modules/@typescript-eslint/typescript-estree/dist/index.js.map
  100. +11 −0 node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts
  101. +1 −0 node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts.map
  102. +18 −0 node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js
  103. +1 −0 node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js.map
  104. +3 −3 node_modules/@typescript-eslint/typescript-estree/package.json
  105. +9 −3 node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts
  106. +1 −1 node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts.map
  107. +4 −4 node_modules/@typescript-eslint/utils/package.json
  108. +2 −2 node_modules/@typescript-eslint/visitor-keys/package.json
  109. +1 −1 node_modules/adm-zip/methods/inflater.js
  110. +1 −1 node_modules/adm-zip/package.json
  111. +8 −0 node_modules/eslint-plugin-github/lib/configs/react.js
  112. +1 −1 node_modules/eslint-plugin-github/package.json
  113. +18 −0 node_modules/uuid/CHANGELOG.md
  114. +134 −16 node_modules/uuid/README.md
  115. +40 −15 node_modules/uuid/dist/commonjs-browser/index.js
  116. +7 −0 node_modules/uuid/dist/commonjs-browser/max.js
  117. +30 −53 node_modules/uuid/dist/commonjs-browser/md5.js
  118. +3 −4 node_modules/uuid/dist/commonjs-browser/native.js
  119. +1 −2 node_modules/uuid/dist/commonjs-browser/nil.js
  120. +14 −15 node_modules/uuid/dist/commonjs-browser/parse.js
  121. +1 −2 node_modules/uuid/dist/commonjs-browser/regex.js
  122. +2 −4 node_modules/uuid/dist/commonjs-browser/rng.js
  123. +27 −49 node_modules/uuid/dist/commonjs-browser/sha1.js
  124. +10 −16 node_modules/uuid/dist/commonjs-browser/stringify.js
  125. +73 −49 node_modules/uuid/dist/commonjs-browser/v1.js
  126. +26 −0 node_modules/uuid/dist/commonjs-browser/v1ToV6.js
  127. +3 −8 node_modules/uuid/dist/commonjs-browser/v3.js
  128. +15 −32 node_modules/uuid/dist/commonjs-browser/v35.js
  129. +7 −18 node_modules/uuid/dist/commonjs-browser/v4.js
  130. +3 −8 node_modules/uuid/dist/commonjs-browser/v5.js
  131. +42 −0 node_modules/uuid/dist/commonjs-browser/v6.js
  132. +26 −0 node_modules/uuid/dist/commonjs-browser/v6ToV1.js
  133. +152 −0 node_modules/uuid/dist/commonjs-browser/v7.js
  134. +2 −7 node_modules/uuid/dist/commonjs-browser/validate.js
  135. +2 −8 node_modules/uuid/dist/commonjs-browser/version.js
  136. +9 −4 node_modules/uuid/dist/esm-browser/index.js
  137. +1 −0 node_modules/uuid/dist/esm-browser/max.js
  138. +29 −50 node_modules/uuid/dist/esm-browser/md5.js
  139. +1 −1 node_modules/uuid/dist/esm-browser/native.js
  140. +12 −10 node_modules/uuid/dist/esm-browser/parse.js
  141. +1 −1 node_modules/uuid/dist/esm-browser/regex.js
  142. +3 −4 node_modules/uuid/dist/esm-browser/rng.js
  143. +26 −46 node_modules/uuid/dist/esm-browser/sha1.js
  144. +9 −11 node_modules/uuid/dist/esm-browser/stringify.js
  145. +74 −44 node_modules/uuid/dist/esm-browser/v1.js
  146. +20 −0 node_modules/uuid/dist/esm-browser/v1ToV6.js
  147. +1 −1 node_modules/uuid/dist/esm-browser/v3.js
  148. +14 −25 node_modules/uuid/dist/esm-browser/v35.js
  149. +5 −9 node_modules/uuid/dist/esm-browser/v4.js
  150. +1 −1 node_modules/uuid/dist/esm-browser/v5.js
  151. +36 −0 node_modules/uuid/dist/esm-browser/v6.js
  152. +20 −0 node_modules/uuid/dist/esm-browser/v6ToV1.js
  153. +146 −0 node_modules/uuid/dist/esm-browser/v7.js
  154. +0 −2 node_modules/uuid/dist/esm-browser/validate.js
  155. +0 −3 node_modules/uuid/dist/esm-browser/version.js
  156. +9 −4 node_modules/uuid/dist/esm-node/index.js
  157. +1 −0 node_modules/uuid/dist/esm-node/max.js
  158. +1 −4 node_modules/uuid/dist/esm-node/md5.js
  159. +1 −1 node_modules/uuid/dist/esm-node/native.js
  160. +11 −9 node_modules/uuid/dist/esm-node/parse.js
  161. +1 −1 node_modules/uuid/dist/esm-node/regex.js
  162. +1 −3 node_modules/uuid/dist/esm-node/rng.js
  163. +1 −4 node_modules/uuid/dist/esm-node/sha1.js
  164. +7 −9 node_modules/uuid/dist/esm-node/stringify.js
  165. +66 −36 node_modules/uuid/dist/esm-node/v1.js
  166. +20 −0 node_modules/uuid/dist/esm-node/v1ToV6.js
  167. +8 −19 node_modules/uuid/dist/esm-node/v35.js
  168. +4 −8 node_modules/uuid/dist/esm-node/v4.js
  169. +32 −0 node_modules/uuid/dist/esm-node/v6.js
  170. +20 −0 node_modules/uuid/dist/esm-node/v6ToV1.js
  171. +146 −0 node_modules/uuid/dist/esm-node/v7.js
  172. +0 −2 node_modules/uuid/dist/esm-node/validate.js
  173. +0 −3 node_modules/uuid/dist/esm-node/version.js
  174. +40 −15 node_modules/uuid/dist/index.js
  175. +7 −0 node_modules/uuid/dist/max.js
  176. +8 −31 node_modules/uuid/dist/md5-browser.js
  177. +4 −10 node_modules/uuid/dist/md5.js
  178. +2 −3 node_modules/uuid/dist/native-browser.js
  179. +5 −9 node_modules/uuid/dist/native.js
  180. +1 −2 node_modules/uuid/dist/nil.js
  181. +13 −14 node_modules/uuid/dist/parse.js
  182. +1 −2 node_modules/uuid/dist/regex.js
  183. +1 −3 node_modules/uuid/dist/rng-browser.js
  184. +3 −10 node_modules/uuid/dist/rng.js
  185. +1 −23 node_modules/uuid/dist/sha1-browser.js
  186. +4 −10 node_modules/uuid/dist/sha1.js
  187. +8 −14 node_modules/uuid/dist/stringify.js
  188. +12 −22 node_modules/uuid/dist/uuid-bin.js
  189. +66 −42 node_modules/uuid/dist/v1.js
  190. +26 −0 node_modules/uuid/dist/v1ToV6.js
  191. +2 −7 node_modules/uuid/dist/v3.js
  192. +11 −28 node_modules/uuid/dist/v35.js
  193. +6 −17 node_modules/uuid/dist/v4.js
  194. +2 −7 node_modules/uuid/dist/v5.js
  195. +38 −0 node_modules/uuid/dist/v6.js
  196. +26 −0 node_modules/uuid/dist/v6ToV1.js
  197. +152 −0 node_modules/uuid/dist/v7.js
  198. +2 −7 node_modules/uuid/dist/validate.js
  199. +2 −8 node_modules/uuid/dist/version.js
  200. +41 −34 node_modules/uuid/package.json
  201. +5 −0 node_modules/uuid/wrapper.mjs
  202. +58 −58 package-lock.json
  203. +6 −6 package.json
  204. +25 −0 pr-checks/checks/cleanup-db-cluster-dir.yml
  205. +4 −0 src/actions-util.ts
  206. +1 −1 src/api-compatibility.json
  207. +8 −1 src/codeql.ts
  208. +24 −0 src/init-action-post-helper.ts
  209. +3 −0 src/init-action.ts
  210. +107 −2 src/init.test.ts
  211. +55 −0 src/init.ts
  212. +1 −0 src/tools-features.ts
81 changes: 81 additions & 0 deletions .github/workflows/__cleanup-db-cluster-dir.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .github/workflows/script/update-node-modules.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
if [ "$1" != "update" && "$1" != "check-only" ]; then
#!/bin/bash
set -eu

if [ "$1" != "update" ] && [ "$1" != "check-only" ]; then
>&2 echo "Failed: Invalid argument. Must be 'update' or 'check-only'"
exit 1
fi

sudo npm install --force -g npm@9.2.0
npm install --force -g npm@9.2.0

# clean the npm cache to ensure we don't have any files owned by root
sudo npm cache clean --force
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,6 +4,11 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

Note that the only difference between `v2` and `v3` of the CodeQL Action is the node version they support, with `v3` running on node 20 while we continue to release `v2` to support running on node 16. For example `3.22.11` was the first `v3` release and is functionally identical to `2.22.11`. This approach ensures an easy way to track exactly which features are included in different versions, indicated by the minor and patch version numbers.

## 3.25.9 - 12 Jun 2024

- Avoid failing database creation if the database folder already exists and contains some unexpected files. Requires CodeQL 2.18.0 or higher. [#2330](https://github.com/github/codeql-action/pull/2330)
- The init Action will attempt to clean up the database cluster directory before creating a new database and at the end of the job. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332)

## 3.25.8 - 04 Jun 2024

- Update default CodeQL bundle version to 2.17.4. [#2321](https://github.com/github/codeql-action/pull/2321)
6 changes: 5 additions & 1 deletion lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/api-compatibility.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "maximumVersion": "3.13", "minimumVersion": "3.9" }
{ "maximumVersion": "3.14", "minimumVersion": "3.9" }
5 changes: 4 additions & 1 deletion lib/codeql.js
2 changes: 1 addition & 1 deletion lib/codeql.js.map

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions lib/init-action-post-helper.js
2 changes: 1 addition & 1 deletion lib/init-action-post-helper.js.map
1 change: 1 addition & 0 deletions lib/init-action.js
2 changes: 1 addition & 1 deletion lib/init-action.js.map

Large diffs are not rendered by default.

39 changes: 38 additions & 1 deletion lib/init.js
2 changes: 1 addition & 1 deletion lib/init.js.map
83 changes: 83 additions & 0 deletions lib/init.test.js
2 changes: 1 addition & 1 deletion lib/init.test.js.map
1 change: 1 addition & 0 deletions lib/tools-features.js
2 changes: 1 addition & 1 deletion lib/tools-features.js.map
104 changes: 52 additions & 52 deletions node_modules/.package-lock.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions node_modules/@typescript-eslint/eslint-plugin/package.json
2 changes: 1 addition & 1 deletion node_modules/@typescript-eslint/parser/dist/index.d.ts
2 changes: 1 addition & 1 deletion node_modules/@typescript-eslint/parser/dist/index.d.ts.map
3 changes: 2 additions & 1 deletion node_modules/@typescript-eslint/parser/dist/index.js
2 changes: 1 addition & 1 deletion node_modules/@typescript-eslint/parser/dist/index.js.map
10 changes: 5 additions & 5 deletions node_modules/@typescript-eslint/parser/package.json
8 changes: 4 additions & 4 deletions node_modules/@typescript-eslint/scope-manager/package.json
8 changes: 4 additions & 4 deletions node_modules/@typescript-eslint/type-utils/package.json
55 changes: 47 additions & 8 deletions node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node_modules/@typescript-eslint/types/package.json
28 changes: 25 additions & 3 deletions node_modules/@typescript-eslint/typescript-estree/dist/convert.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions node_modules/@typescript-eslint/utils/package.json
4 changes: 2 additions & 2 deletions node_modules/@typescript-eslint/visitor-keys/package.json
2 changes: 1 addition & 1 deletion node_modules/adm-zip/methods/inflater.js
2 changes: 1 addition & 1 deletion node_modules/adm-zip/package.json
8 changes: 8 additions & 0 deletions node_modules/eslint-plugin-github/lib/configs/react.js
2 changes: 1 addition & 1 deletion node_modules/eslint-plugin-github/package.json
18 changes: 18 additions & 0 deletions node_modules/uuid/CHANGELOG.md
150 changes: 134 additions & 16 deletions node_modules/uuid/README.md
55 changes: 40 additions & 15 deletions node_modules/uuid/dist/commonjs-browser/index.js
7 changes: 7 additions & 0 deletions node_modules/uuid/dist/commonjs-browser/max.js
83 changes: 30 additions & 53 deletions node_modules/uuid/dist/commonjs-browser/md5.js
7 changes: 3 additions & 4 deletions node_modules/uuid/dist/commonjs-browser/native.js
3 changes: 1 addition & 2 deletions node_modules/uuid/dist/commonjs-browser/nil.js
29 changes: 14 additions & 15 deletions node_modules/uuid/dist/commonjs-browser/parse.js
3 changes: 1 addition & 2 deletions node_modules/uuid/dist/commonjs-browser/regex.js
6 changes: 2 additions & 4 deletions node_modules/uuid/dist/commonjs-browser/rng.js
76 changes: 27 additions & 49 deletions node_modules/uuid/dist/commonjs-browser/sha1.js
26 changes: 10 additions & 16 deletions node_modules/uuid/dist/commonjs-browser/stringify.js
122 changes: 73 additions & 49 deletions node_modules/uuid/dist/commonjs-browser/v1.js
26 changes: 26 additions & 0 deletions node_modules/uuid/dist/commonjs-browser/v1ToV6.js
11 changes: 3 additions & 8 deletions node_modules/uuid/dist/commonjs-browser/v3.js
47 changes: 15 additions & 32 deletions node_modules/uuid/dist/commonjs-browser/v35.js
25 changes: 7 additions & 18 deletions node_modules/uuid/dist/commonjs-browser/v4.js
11 changes: 3 additions & 8 deletions node_modules/uuid/dist/commonjs-browser/v5.js
42 changes: 42 additions & 0 deletions node_modules/uuid/dist/commonjs-browser/v6.js
26 changes: 26 additions & 0 deletions node_modules/uuid/dist/commonjs-browser/v6ToV1.js
152 changes: 152 additions & 0 deletions node_modules/uuid/dist/commonjs-browser/v7.js
9 changes: 2 additions & 7 deletions node_modules/uuid/dist/commonjs-browser/validate.js
10 changes: 2 additions & 8 deletions node_modules/uuid/dist/commonjs-browser/version.js
13 changes: 9 additions & 4 deletions node_modules/uuid/dist/esm-browser/index.js
1 change: 1 addition & 0 deletions node_modules/uuid/dist/esm-browser/max.js
79 changes: 29 additions & 50 deletions node_modules/uuid/dist/esm-browser/md5.js
2 changes: 1 addition & 1 deletion node_modules/uuid/dist/esm-browser/native.js
22 changes: 12 additions & 10 deletions node_modules/uuid/dist/esm-browser/parse.js
2 changes: 1 addition & 1 deletion node_modules/uuid/dist/esm-browser/regex.js
7 changes: 3 additions & 4 deletions node_modules/uuid/dist/esm-browser/rng.js
72 changes: 26 additions & 46 deletions node_modules/uuid/dist/esm-browser/sha1.js
20 changes: 9 additions & 11 deletions node_modules/uuid/dist/esm-browser/stringify.js
118 changes: 74 additions & 44 deletions node_modules/uuid/dist/esm-browser/v1.js
20 changes: 20 additions & 0 deletions node_modules/uuid/dist/esm-browser/v1ToV6.js
2 changes: 1 addition & 1 deletion node_modules/uuid/dist/esm-browser/v3.js
39 changes: 14 additions & 25 deletions node_modules/uuid/dist/esm-browser/v35.js
14 changes: 5 additions & 9 deletions node_modules/uuid/dist/esm-browser/v4.js
2 changes: 1 addition & 1 deletion node_modules/uuid/dist/esm-browser/v5.js
36 changes: 36 additions & 0 deletions node_modules/uuid/dist/esm-browser/v6.js
20 changes: 20 additions & 0 deletions node_modules/uuid/dist/esm-browser/v6ToV1.js
146 changes: 146 additions & 0 deletions node_modules/uuid/dist/esm-browser/v7.js
2 changes: 0 additions & 2 deletions node_modules/uuid/dist/esm-browser/validate.js
3 changes: 0 additions & 3 deletions node_modules/uuid/dist/esm-browser/version.js
13 changes: 9 additions & 4 deletions node_modules/uuid/dist/esm-node/index.js
1 change: 1 addition & 0 deletions node_modules/uuid/dist/esm-node/max.js
5 changes: 1 addition & 4 deletions node_modules/uuid/dist/esm-node/md5.js
2 changes: 1 addition & 1 deletion node_modules/uuid/dist/esm-node/native.js
20 changes: 11 additions & 9 deletions node_modules/uuid/dist/esm-node/parse.js
2 changes: 1 addition & 1 deletion node_modules/uuid/dist/esm-node/regex.js
4 changes: 1 addition & 3 deletions node_modules/uuid/dist/esm-node/rng.js
5 changes: 1 addition & 4 deletions node_modules/uuid/dist/esm-node/sha1.js
16 changes: 7 additions & 9 deletions node_modules/uuid/dist/esm-node/stringify.js
102 changes: 66 additions & 36 deletions node_modules/uuid/dist/esm-node/v1.js
20 changes: 20 additions & 0 deletions node_modules/uuid/dist/esm-node/v1ToV6.js
27 changes: 8 additions & 19 deletions node_modules/uuid/dist/esm-node/v35.js
12 changes: 4 additions & 8 deletions node_modules/uuid/dist/esm-node/v4.js
32 changes: 32 additions & 0 deletions node_modules/uuid/dist/esm-node/v6.js
20 changes: 20 additions & 0 deletions node_modules/uuid/dist/esm-node/v6ToV1.js
146 changes: 146 additions & 0 deletions node_modules/uuid/dist/esm-node/v7.js
2 changes: 0 additions & 2 deletions node_modules/uuid/dist/esm-node/validate.js
3 changes: 0 additions & 3 deletions node_modules/uuid/dist/esm-node/version.js
55 changes: 40 additions & 15 deletions node_modules/uuid/dist/index.js
7 changes: 7 additions & 0 deletions node_modules/uuid/dist/max.js
39 changes: 8 additions & 31 deletions node_modules/uuid/dist/md5-browser.js
14 changes: 4 additions & 10 deletions node_modules/uuid/dist/md5.js
5 changes: 2 additions & 3 deletions node_modules/uuid/dist/native-browser.js
14 changes: 5 additions & 9 deletions node_modules/uuid/dist/native.js
3 changes: 1 addition & 2 deletions node_modules/uuid/dist/nil.js
27 changes: 13 additions & 14 deletions node_modules/uuid/dist/parse.js
3 changes: 1 addition & 2 deletions node_modules/uuid/dist/regex.js
4 changes: 1 addition & 3 deletions node_modules/uuid/dist/rng-browser.js
13 changes: 3 additions & 10 deletions node_modules/uuid/dist/rng.js
24 changes: 1 addition & 23 deletions node_modules/uuid/dist/sha1-browser.js
14 changes: 4 additions & 10 deletions node_modules/uuid/dist/sha1.js
22 changes: 8 additions & 14 deletions node_modules/uuid/dist/stringify.js
34 changes: 12 additions & 22 deletions node_modules/uuid/dist/uuid-bin.js
108 changes: 66 additions & 42 deletions node_modules/uuid/dist/v1.js
26 changes: 26 additions & 0 deletions node_modules/uuid/dist/v1ToV6.js
9 changes: 2 additions & 7 deletions node_modules/uuid/dist/v3.js
39 changes: 11 additions & 28 deletions node_modules/uuid/dist/v35.js
23 changes: 6 additions & 17 deletions node_modules/uuid/dist/v4.js
9 changes: 2 additions & 7 deletions node_modules/uuid/dist/v5.js
38 changes: 38 additions & 0 deletions node_modules/uuid/dist/v6.js
26 changes: 26 additions & 0 deletions node_modules/uuid/dist/v6ToV1.js
152 changes: 152 additions & 0 deletions node_modules/uuid/dist/v7.js
9 changes: 2 additions & 7 deletions node_modules/uuid/dist/validate.js
10 changes: 2 additions & 8 deletions node_modules/uuid/dist/version.js
75 changes: 41 additions & 34 deletions node_modules/uuid/package.json
5 changes: 5 additions & 0 deletions node_modules/uuid/wrapper.mjs
116 changes: 58 additions & 58 deletions package-lock.json
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeql",
"version": "3.25.8",
"version": "3.25.9",
"private": true,
"description": "CodeQL action",
"scripts": {
@@ -33,7 +33,7 @@
"@octokit/types": "^13.5.0",
"@schemastore/package": "0.0.10",
"@types/uuid": "^9.0.8",
"adm-zip": "^0.5.13",
"adm-zip": "^0.5.14",
"check-disk-space": "^3.4.0",
"console-log-level": "^1.4.1",
"del": "^6.1.1",
@@ -46,7 +46,7 @@
"long": "^5.2.3",
"path": "^0.12.7",
"semver": "^7.6.2",
"uuid": "^9.0.1",
"uuid": "^10.0.0",
"zlib": "^1.0.5"
},
"//": [
@@ -60,13 +60,13 @@
"@types/node": "20.9.0",
"@types/semver": "^7.5.8",
"@types/sinon": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"ava": "^5.3.1",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-github": "^5.0.0",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-async-foreach": "^0.1.1",
"micromatch": "4.0.7",
25 changes: 25 additions & 0 deletions pr-checks/checks/cleanup-db-cluster-dir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Clean up database cluster directory"
description: "The database cluster directory is cleaned up if it is not empty."
operatingSystems: ["ubuntu"]
versions: ["linked"]
steps:
- name: Add a file to the database cluster directory
run: |
mkdir -p "${{ runner.temp }}/customDbLocation/javascript"
touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt"
- uses: ./../action/init
id: init
with:
build-mode: none
db-location: "${{ runner.temp }}/customDbLocation"
languages: javascript
tools: ${{ steps.prepare-test.outputs.tools-url }}

- name: Validate file cleaned up
run: |
if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then
echo "File was not cleaned up"
exit 1
fi
echo "File was cleaned up"
4 changes: 4 additions & 0 deletions src/actions-util.ts
Original file line number Diff line number Diff line change
@@ -476,3 +476,7 @@ export const getFileType = async (filePath: string): Promise<string> => {
throw e;
}
};

export function isSelfHostedRunner() {
return process.env.RUNNER_ENVIRONMENT === "self-hosted";
}
2 changes: 1 addition & 1 deletion src/api-compatibility.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"maximumVersion": "3.13", "minimumVersion": "3.9"}
{"maximumVersion": "3.14", "minimumVersion": "3.9"}
9 changes: 8 additions & 1 deletion src/codeql.ts
Original file line number Diff line number Diff line change
@@ -612,12 +612,19 @@ export async function getCodeQLForCmd(
extraArgs.push("--no-sublanguage-file-coverage");
}

const overwriteFlag = isSupportedToolsFeature(
await this.getVersion(),
ToolsFeature.ForceOverwrite,
)
? "--force-overwrite"
: "--overwrite";

await runTool(
cmd,
[
"database",
"init",
"--overwrite",
overwriteFlag,
"--db-cluster",
config.dbLocation,
`--source-root=${sourceRoot}`,
24 changes: 24 additions & 0 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as fs from "fs";

import * as core from "@actions/core";
import * as github from "@actions/github";

@@ -217,6 +219,28 @@ export async function run(
await printDebugLogs(config);
}

if (actionsUtil.isSelfHostedRunner()) {
try {
fs.rmSync(config.dbLocation, {
recursive: true,
force: true,
maxRetries: 3,
});
logger.info(
`Cleaned up database cluster directory ${config.dbLocation}.`,
);
} catch (e) {
logger.warning(
`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`,
);
}
} else {
logger.debug(
"Skipping cleanup of database cluster directory since we are running on a GitHub-hosted " +
"runner which will be automatically cleaned up.",
);
}

return uploadFailedSarifResult;
}

3 changes: 3 additions & 0 deletions src/init-action.ts
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ import { EnvVar } from "./environment";
import { Feature, Features } from "./feature-flags";
import {
checkInstallPython311,
cleanupDatabaseClusterDirectory,
initCodeQL,
initConfig,
isSipEnabled,
@@ -321,6 +322,8 @@ async function run() {
}

try {
cleanupDatabaseClusterDirectory(config, logger);

// Forward Go flags
const goFlags = process.env["GOFLAGS"];
if (goFlags) {
109 changes: 107 additions & 2 deletions src/init.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import * as fs from "fs";
import path from "path";

import test from "ava";

import { Config } from "./config-utils";
import { printPathFiltersWarning } from "./init";
import {
cleanupDatabaseClusterDirectory,
printPathFiltersWarning,
} from "./init";
import { Language } from "./languages";
import { LoggedMessage, getRecordingLogger, setupTests } from "./testing-utils";
import {
LoggedMessage,
createTestConfig,
getRecordingLogger,
setupTests,
} from "./testing-utils";
import { ConfigurationError, withTmpDir } from "./util";

setupTests(test);

@@ -30,3 +42,96 @@ test("printPathFiltersWarning does not trigger when 'paths' and 'paths-ignore' a
);
t.is(messages.length, 0);
});

test("cleanupDatabaseClusterDirectory cleans up where possible", async (t) => {
await withTmpDir(async (tmpDir: string) => {
const dbLocation = path.resolve(tmpDir, "dbs");
fs.mkdirSync(dbLocation, { recursive: true });

const fileToCleanUp = path.resolve(dbLocation, "something-to-cleanup.txt");
fs.writeFileSync(fileToCleanUp, "");

const messages: LoggedMessage[] = [];
cleanupDatabaseClusterDirectory(
createTestConfig({ dbLocation }),
getRecordingLogger(messages),
);

t.is(messages.length, 2);
t.is(messages[0].type, "warning");
t.is(
messages[0].message,
`The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`,
);
t.is(messages[1].type, "info");
t.is(
messages[1].message,
`Cleaned up database cluster directory ${dbLocation}.`,
);

t.false(fs.existsSync(fileToCleanUp));
});
});

for (const { runnerEnv, ErrorConstructor, message } of [
{
runnerEnv: "self-hosted",
ErrorConstructor: ConfigurationError,
message: (dbLocation) =>
"The CodeQL Action requires an empty database cluster directory. By default, this is located " +
`at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` +
"attempt was made to clean up the directory, but this failed. This can happen if another " +
"process is using the directory or the directory is owned by a different user. Please clean " +
"up the directory manually and rerun the job.",
},
{
runnerEnv: "github-hosted",
ErrorConstructor: Error,
message: (dbLocation) =>
"The CodeQL Action requires an empty database cluster directory. By default, this is located " +
`at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` +
"attempt was made to clean up the directory, but this failed. This shouldn't typically " +
"happen on hosted runners. If you are using an advanced setup, please check your workflow, " +
"otherwise we recommend rerunning the job.",
},
]) {
test(`cleanupDatabaseClusterDirectory throws a ${ErrorConstructor.name} when cleanup fails on ${runnerEnv} runner`, async (t) => {
await withTmpDir(async (tmpDir: string) => {
process.env["RUNNER_ENVIRONMENT"] = runnerEnv;

const dbLocation = path.resolve(tmpDir, "dbs");
fs.mkdirSync(dbLocation, { recursive: true });

const fileToCleanUp = path.resolve(
dbLocation,
"something-to-cleanup.txt",
);
fs.writeFileSync(fileToCleanUp, "");

const rmSyncError = `Failed to clean up file ${fileToCleanUp}`;

const messages: LoggedMessage[] = [];
t.throws(
() =>
cleanupDatabaseClusterDirectory(
createTestConfig({ dbLocation }),
getRecordingLogger(messages),
() => {
throw new Error(rmSyncError);
},
),
{
instanceOf: ErrorConstructor,
message: `${message(dbLocation)} Details: ${rmSyncError}`,
},
);

t.is(messages.length, 1);
t.is(messages[0].type, "warning");
t.is(
messages[0].message,
`The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`,
);
});
});
}
55 changes: 55 additions & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import * as exec from "@actions/exec/lib/exec";
import * as toolrunner from "@actions/exec/lib/toolrunner";
import * as safeWhich from "@chrisgavin/safe-which";

import { getOptionalInput, isSelfHostedRunner } from "./actions-util";
import { GitHubApiCombinedDetails, GitHubApiDetails } from "./api-client";
import { CodeQL, setupCodeQL } from "./codeql";
import * as configUtils from "./config-utils";
@@ -171,3 +172,57 @@ export async function isSipEnabled(logger): Promise<boolean | undefined> {
return undefined;
}
}

export function cleanupDatabaseClusterDirectory(
config: configUtils.Config,
logger: Logger,
// We can't stub the fs module in tests, so we allow the caller to override the rmSync function
// for testing.
rmSync = fs.rmSync,
): void {
if (
fs.existsSync(config.dbLocation) &&
(fs.statSync(config.dbLocation).isFile() ||
fs.readdirSync(config.dbLocation).length)
) {
logger.warning(
`The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.`,
);
try {
rmSync(config.dbLocation, {
force: true,
maxRetries: 3,
recursive: true,
});

logger.info(
`Cleaned up database cluster directory ${config.dbLocation}.`,
);
} catch (e) {
const blurb = `The CodeQL Action requires an empty database cluster directory. ${
getOptionalInput("db-location")
? `This is currently configured to be ${config.dbLocation}. `
: `By default, this is located at ${config.dbLocation}. ` +
"You can customize it using the 'db-location' input to the init Action. "
}An attempt was made to clean up the directory, but this failed.`;

// Hosted runners are automatically cleaned up, so this error should not occur for hosted runners.
if (isSelfHostedRunner()) {
throw new util.ConfigurationError(
`${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` +
`Please clean up the directory manually and rerun the job. Details: ${
util.wrapError(e).message
}`,
);
} else {
throw new Error(
`${blurb} This shouldn't typically happen on hosted runners. ` +
"If you are using an advanced setup, please check your workflow, otherwise we " +
`recommend rerunning the job. Details: ${
util.wrapError(e).message
}`,
);
}
}
}
}
1 change: 1 addition & 0 deletions src/tools-features.ts
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ export enum ToolsFeature {
SetsCodeqlRunnerEnvVar = "setsCodeqlRunnerEnvVar",
TraceCommandUseBuildMode = "traceCommandUseBuildMode",
SarifMergeRunsFromEqualCategory = "sarifMergeRunsFromEqualCategory",
ForceOverwrite = "forceOverwrite",
}

/**