diff --git a/.github/actions/setup-swift/action.yml b/.github/actions/setup-swift/action.yml deleted file mode 100644 index 374eb207b..000000000 --- a/.github/actions/setup-swift/action.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "Set up Swift on Linux" -description: Sets up an appropriate Swift version on Linux. -inputs: - codeql-path: - description: Path to the CodeQL CLI executable. - required: true -runs: - using: "composite" - steps: - - name: Get Swift version - id: get_swift_version - if: runner.os == 'Linux' - shell: bash - env: - CODEQL_PATH: ${{ inputs.codeql-path }} - run: | - SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')" - if [ $SWIFT_EXTRACTOR_DIR = "null" ]; then - VERSION="null" - else - VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/linux64/extractor" --version | awk '/version/ { print $3 }')" - # Specify 5.x.0, otherwise setup Action will default to latest minor version. - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - elif [ $VERSION = "5.8" ]; then - VERSION="5.8.0" - elif [ $VERSION = "5.9" ]; then - VERSION="5.9.0" - # setup-swift does not yet support v5.9.1 Remove this when it does. - elif [ $VERSION = "5.9.1" ]; then - VERSION="5.9.0" - fi - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - - uses: redsun82/setup-swift@362f49f31da2f5f4f851657046bdd1290d03edc8 # Please update the corresponding SHA in the CLI's CodeQL Action Integration Test. - if: runner.os == 'Linux' && steps.get_swift_version.outputs.version != 'null' - with: - swift-version: "${{ steps.get_swift_version.outputs.version }}" diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml index 2cff8956e..0343a1c2a 100644 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml @@ -65,7 +65,7 @@ jobs: use-all-platform-bundle: 'false' setup-kotlin: 'true' - name: Install Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: ${{ inputs.java-version || '17' }} distribution: temurin diff --git a/.github/workflows/__autobuild-direct-tracing.yml b/.github/workflows/__autobuild-direct-tracing.yml index 58273261f..0841d769a 100644 --- a/.github/workflows/__autobuild-direct-tracing.yml +++ b/.github/workflows/__autobuild-direct-tracing.yml @@ -65,7 +65,7 @@ jobs: use-all-platform-bundle: 'false' setup-kotlin: 'true' - name: Install Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: ${{ inputs.java-version || '17' }} distribution: temurin diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 411a0c701..86c519d5a 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -72,10 +72,6 @@ jobs: with: languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - if: runner.os == 'macOS' - with: - codeql-path: ${{ steps.init.outputs.codeql-path }} - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 5a56f8bdb..e5f157881 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -93,6 +93,11 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Use Xcode 16 + shell: bash + if: runner.os == 'macOS' && matrix.version != 'nightly-latest' + run: sudo xcode-select -s "/Applications/Xcode_16.app" + - uses: ./../action/init id: init with: @@ -101,11 +106,6 @@ jobs: || '' }} tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - if: runner.os == 'macOS' - with: - codeql-path: ${{ steps.init.outputs.codeql-path }} - - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index 229455adf..16bfa3bc1 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -49,7 +49,7 @@ jobs: use-all-platform-bundle: 'false' setup-kotlin: 'true' - name: Set up Ruby - uses: ruby/setup-ruby@829114fc20da43a41d27359103ec7a63020954d4 # v1.255.0 + uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0 with: ruby-version: 2.6 - name: Install Code Scanning integration diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 7dd3afec2..82045f1a4 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -54,9 +54,6 @@ jobs: languages: swift build-mode: autobuild tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - with: - codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory shell: bash run: pwd diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 0d3e92740..8fdb34724 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -67,14 +67,15 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Use Xcode 16 + shell: bash + if: runner.os == 'macOS' && matrix.version != 'nightly-latest' + run: sudo xcode-select -s "/Applications/Xcode_16.app" - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - with: - codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory shell: bash run: pwd diff --git a/init/action.yml b/init/action.yml index cb4908e92..bb343a90b 100644 --- a/init/action.yml +++ b/init/action.yml @@ -42,6 +42,19 @@ inputs: your workflow between the `init` and `analyze` steps. Available for all compiled languages. required: false + analysis-kinds: + description: >- + [Internal] A comma-separated list of analysis kinds to enable. This input is intended for + internal-use only at this time and the behaviour is subject to changes. Some features may + not be available depending on which analysis kinds are enabled. + + Available options are: + + - `code-scanning`: The default, security-focused analysis. + - `code-quality`: Analysis focused on code quality. This must be enabled in conjunction + with `code-scanning`. + default: 'code-scanning' + required: true token: description: GitHub token to use for authenticating with this instance of GitHub. To download custom packs from multiple registries, use the registries input. default: ${{ github.token }} diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index c47f436fa..1a89a36e2 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -125766,6 +125766,14 @@ var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 98b3386ab..708ca4cec 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -93073,6 +93073,14 @@ var fs6 = __toESM(require("fs")); var path6 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); async function getTotalCacheSize(paths, logger, quiet = false) { @@ -94177,6 +94185,9 @@ function generateCodeScanningConfig(originalUserInput, augmentationProperties) { } return augmentedConfig; } +function isCodeQualityEnabled(config) { + return config.analysisKinds.includes("code-quality" /* CodeQuality */); +} // src/setup-codeql.ts var fs9 = __toESM(require("fs")); @@ -96156,7 +96167,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, try { const sarifFile = path12.join(sarifFolder, `${language}.sarif`); const queries = []; - if (config.augmentationProperties.qualityQueriesInput !== void 0) { + if (isCodeQualityEnabled(config)) { queries.push(getGeneratedSuitePath(config, language)); for (const qualityQuery of config.augmentationProperties.qualityQueriesInput) { queries.push(resolveQuerySuiteAlias(language, qualityQuery.uses)); @@ -96178,7 +96189,7 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, automationDetailsId ); let qualityAnalysisSummary; - if (config.augmentationProperties.qualityQueriesInput !== void 0) { + if (isCodeQualityEnabled(config)) { logger.info(`Interpreting quality results for ${language}`); const qualityCategory = fixCodeQualityCategory( logger, @@ -96439,6 +96450,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, @@ -98526,7 +98538,7 @@ async function run() { CodeScanningTarget ); core13.setOutput("sarif-id", uploadResult.sarifID); - if (config.augmentationProperties.qualityQueriesInput !== void 0) { + if (isCodeQualityEnabled(config)) { const qualityUploadResult = await uploadFiles( outputDir, getRequiredInput("checkout_path"), diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 78142078c..d789fe147 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -87329,6 +87329,14 @@ var fs4 = __toESM(require("fs")); var path4 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); @@ -88870,6 +88878,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, diff --git a/lib/init-action-post.js b/lib/init-action-post.js index b2dc5fe7d..814e527f6 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -130473,6 +130473,14 @@ var fs6 = __toESM(require("fs")); var path6 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); @@ -133106,6 +133114,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, diff --git a/lib/init-action.js b/lib/init-action.js index ec5032e4e..0e968ef06 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -88664,6 +88664,30 @@ var path6 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); +async function parseAnalysisKinds(input) { + const components = input.split(","); + if (components.length < 1) { + throw new ConfigurationError( + "At least one analysis kind must be configured." + ); + } + for (const component of components) { + if (!supportedAnalysisKinds.has(component)) { + throw new ConfigurationError(`Unknown analysis kind: ${component}`); + } + } + return Array.from( + new Set(components.map((component) => component)) + ); +} + // src/feature-flags.ts var fs4 = __toESM(require("fs")); var path4 = __toESM(require("path")); @@ -89743,6 +89767,7 @@ async function getRawLanguages(languagesInput, repository, sourceRoot, logger) { }; } async function getDefaultConfig({ + analysisKindsInput, languagesInput, queriesInput, qualityQueriesInput, @@ -89762,6 +89787,10 @@ async function getDefaultConfig({ features, logger }) { + const analysisKinds = await parseAnalysisKinds(analysisKindsInput); + if (!analysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) { + analysisKinds.push("code-quality" /* CodeQuality */); + } const languages = await getLanguages( codeql, languagesInput, @@ -89788,6 +89817,7 @@ async function getDefaultConfig({ logger ); return { + analysisKinds, languages, buildMode, originalUserInput: {}, @@ -92368,6 +92398,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, @@ -92830,6 +92861,7 @@ async function run() { } } config = await initConfig2({ + analysisKindsInput: getRequiredInput("analysis-kinds"), languagesInput: getOptionalInput("languages"), queriesInput: getOptionalInput("queries"), qualityQueriesInput: getOptionalInput("quality-queries"), diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 76d8f0ab9..94b2e6d3e 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -87328,6 +87328,14 @@ var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); @@ -88497,6 +88505,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index ba060abf5..b1c94d437 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -125406,6 +125406,14 @@ var fs = __toESM(require("fs")); var path = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index 725c55ba1..3334e57b3 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -54933,10 +54933,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -54960,18 +54957,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", diff --git a/lib/upload-lib.js b/lib/upload-lib.js index b7e0cdaf7..89cf36f97 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -37728,10 +37728,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -37755,18 +37752,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -91420,6 +91420,14 @@ var fs4 = __toESM(require("fs")); var path5 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 66a0d772b..579e0bf37 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -125561,6 +125561,14 @@ var cliErrorsConfig = { // src/config-utils.ts var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core5 = __toESM(require_core()); diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 70d52083a..7f40a87ab 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -36405,10 +36405,7 @@ var require_package = __commonJS({ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", archiver: "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -36432,18 +36429,21 @@ var require_package = __commonJS({ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", ava: "^6.4.1", esbuild: "^0.25.9", eslint: "^8.57.1", @@ -92183,6 +92183,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, @@ -92554,6 +92555,14 @@ var fs5 = __toESM(require("fs")); var path6 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); +// src/analyses.ts +var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { + AnalysisKind2["CodeScanning"] = "code-scanning"; + AnalysisKind2["CodeQuality"] = "code-quality"; + return AnalysisKind2; +})(AnalysisKind || {}); +var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + // src/caching-utils.ts var core8 = __toESM(require_core()); diff --git a/package-lock.json b/package-lock.json index 6cfefa653..7fbe470ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,10 +20,7 @@ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", "archiver": "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -47,18 +44,21 @@ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", "ava": "^6.4.1", "esbuild": "^0.25.9", "eslint": "^8.57.1", @@ -1337,9 +1337,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.33.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.33.0.tgz", - "integrity": "sha512-5K1/mKhWaMfreBGJTwval43JJmkip0RmM+3+IuqupeSKNC/Th2Kc7ucaq5ovTSra/OOKB9c58CGSz3QMVbWt0A==", + "version": "9.34.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz", + "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==", "dev": true, "license": "MIT", "engines": { @@ -2483,15 +2483,17 @@ "version": "20.19.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.9.tgz", "integrity": "sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==", + "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, "node_modules/@types/node-forge": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.13.tgz", - "integrity": "sha512-zePQJSW5QkwSHKRApqWCVKeKoSOt4xvEnLENZPjyvm9Ezdf/EyDeJM7jqLzOwjVICQQzvLZ63T55MKdJB5H6ww==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.14.tgz", + "integrity": "sha512-mhVF2BnD4BO+jtOp7z1CdzaK4mbuK0LLQYAvdOLqHTavxFNq4zA1EmYkpnFjP8HOUzedfQkRnp0E2ulSAYSzAw==", + "dev": true, "license": "MIT", "dependencies": { "@types/node": "*" @@ -2530,20 +2532,21 @@ }, "node_modules/@types/uuid": { "version": "10.0.0", + "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.40.0.tgz", - "integrity": "sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.41.0.tgz", + "integrity": "sha512-8fz6oa6wEKZrhXWro/S3n2eRJqlRcIa6SlDh59FXJ5Wp5XRZ8B9ixpJDcjadHq47hMx0u+HW6SNa6LjJQ6NLtw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/type-utils": "8.40.0", - "@typescript-eslint/utils": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/type-utils": "8.41.0", + "@typescript-eslint/utils": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -2557,20 +2560,20 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.40.0", + "@typescript-eslint/parser": "^8.41.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.40.0.tgz", - "integrity": "sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz", + "integrity": "sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0" + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2581,9 +2584,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.40.0.tgz", - "integrity": "sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz", + "integrity": "sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==", "dev": true, "license": "MIT", "engines": { @@ -2595,16 +2598,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.40.0.tgz", - "integrity": "sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz", + "integrity": "sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.40.0", - "@typescript-eslint/tsconfig-utils": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/project-service": "8.41.0", + "@typescript-eslint/tsconfig-utils": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2624,16 +2627,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.40.0.tgz", - "integrity": "sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.41.0.tgz", + "integrity": "sha512-udbCVstxZ5jiPIXrdH+BZWnPatjlYwJuJkDA4Tbo3WyYLh8NvB+h/bKeSZHDOFKfphsZYJQqaFtLeXEqurQn1A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0" + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2648,13 +2651,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.40.0.tgz", - "integrity": "sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz", + "integrity": "sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/types": "8.41.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -2727,16 +2730,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.40.0.tgz", - "integrity": "sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.41.0.tgz", + "integrity": "sha512-gTtSdWX9xiMPA/7MV9STjJOOYtWwIJIYxkQxnSV1U3xcE+mnJSH3f6zI0RYP+ew66WSlZ5ed+h0VCxsvdC1jJg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "debug": "^4.3.4" }, "engines": { @@ -2752,14 +2755,14 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.40.0.tgz", - "integrity": "sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz", + "integrity": "sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0" + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2770,9 +2773,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.40.0.tgz", - "integrity": "sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz", + "integrity": "sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==", "dev": true, "license": "MIT", "engines": { @@ -2784,16 +2787,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.40.0.tgz", - "integrity": "sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz", + "integrity": "sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.40.0", - "@typescript-eslint/tsconfig-utils": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/project-service": "8.41.0", + "@typescript-eslint/tsconfig-utils": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2813,13 +2816,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.40.0.tgz", - "integrity": "sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz", + "integrity": "sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/types": "8.41.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -2883,14 +2886,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.40.0.tgz", - "integrity": "sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.41.0.tgz", + "integrity": "sha512-b8V9SdGBQzQdjJ/IO3eDifGpDBJfvrNTp2QD9P2BeqWTGrRibgfgIlBSw6z3b6R7dPzg752tOs4u/7yCLxksSQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.40.0", - "@typescript-eslint/types": "^8.40.0", + "@typescript-eslint/tsconfig-utils": "^8.41.0", + "@typescript-eslint/types": "^8.41.0", "debug": "^4.3.4" }, "engines": { @@ -2905,9 +2908,9 @@ } }, "node_modules/@typescript-eslint/project-service/node_modules/@typescript-eslint/types": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.40.0.tgz", - "integrity": "sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz", + "integrity": "sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==", "dev": true, "license": "MIT", "engines": { @@ -2937,9 +2940,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.40.0.tgz", - "integrity": "sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.41.0.tgz", + "integrity": "sha512-TDhxYFPUYRFxFhuU5hTIJk+auzM/wKvWgoNYOPcOf6i4ReYlOoYN8q1dV5kOTjNQNJgzWN3TUUQMtlLOcUgdUw==", "dev": true, "license": "MIT", "engines": { @@ -2954,15 +2957,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.40.0.tgz", - "integrity": "sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.41.0.tgz", + "integrity": "sha512-63qt1h91vg3KsjVVonFJWjgSK7pZHSQFKH6uwqxAH9bBrsyRhO6ONoKyXxyVBzG1lJnFAJcKAcxLS54N1ee1OQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0", - "@typescript-eslint/utils": "8.40.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0", + "@typescript-eslint/utils": "8.41.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -2979,14 +2982,14 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.40.0.tgz", - "integrity": "sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz", + "integrity": "sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0" + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2997,9 +3000,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.40.0.tgz", - "integrity": "sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz", + "integrity": "sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==", "dev": true, "license": "MIT", "engines": { @@ -3011,16 +3014,16 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.40.0.tgz", - "integrity": "sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz", + "integrity": "sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.40.0", - "@typescript-eslint/tsconfig-utils": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/visitor-keys": "8.40.0", + "@typescript-eslint/project-service": "8.41.0", + "@typescript-eslint/tsconfig-utils": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/visitor-keys": "8.41.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -3040,16 +3043,16 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.40.0.tgz", - "integrity": "sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.41.0.tgz", + "integrity": "sha512-udbCVstxZ5jiPIXrdH+BZWnPatjlYwJuJkDA4Tbo3WyYLh8NvB+h/bKeSZHDOFKfphsZYJQqaFtLeXEqurQn1A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.40.0", - "@typescript-eslint/types": "8.40.0", - "@typescript-eslint/typescript-estree": "8.40.0" + "@typescript-eslint/scope-manager": "8.41.0", + "@typescript-eslint/types": "8.41.0", + "@typescript-eslint/typescript-estree": "8.41.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3064,13 +3067,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.40.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.40.0.tgz", - "integrity": "sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==", + "version": "8.41.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz", + "integrity": "sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/types": "8.41.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -9105,6 +9108,7 @@ "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, "license": "MIT" }, "node_modules/unicorn-magic": { diff --git a/package.json b/package.json index 816ca14f0..dc5f7f963 100644 --- a/package.json +++ b/package.json @@ -35,10 +35,7 @@ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/types": "^14.1.0", "@schemastore/package": "0.0.10", - "@types/node-forge": "^1.3.13", - "@types/uuid": "^10.0.0", "archiver": "^7.0.1", "check-disk-space": "^3.4.0", "console-log-level": "^1.4.1", @@ -62,18 +59,21 @@ "@ava/typescript": "6.0.0", "@eslint/compat": "^1.3.2", "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.33.0", + "@eslint/js": "^9.34.0", "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^14.1.0", "@types/archiver": "^6.0.3", "@types/console-log-level": "^1.4.5", "@types/follow-redirects": "^1.14.4", "@types/get-folder-size": "^2.0.0", "@types/js-yaml": "^4.0.9", "@types/node": "20.19.9", + "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.0", "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.40.0", - "@typescript-eslint/parser": "^8.40.0", + "@types/uuid": "^10.0.0", + "@typescript-eslint/eslint-plugin": "^8.41.0", + "@typescript-eslint/parser": "^8.41.0", "ava": "^6.4.1", "esbuild": "^0.25.9", "eslint": "^8.57.1", diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index b4ba79eb3..6ba349883 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -10,10 +10,6 @@ steps: with: languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - if: runner.os == 'macOS' - with: - codeql-path: ${{ steps.init.outputs.codeql-path }} - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 8ac8a6cc0..e663c4f8f 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -3,6 +3,11 @@ description: "An end-to-end integration test of a multi-language repository usin operatingSystems: ["macos", "ubuntu"] installGo: true steps: + - name: Use Xcode 16 + shell: bash + if: runner.os == 'macOS' && matrix.version != 'nightly-latest' + run: sudo xcode-select -s "/Applications/Xcode_16.app" + - uses: ./../action/init id: init with: @@ -10,11 +15,6 @@ steps: languages: ${{ runner.os == 'Linux' && 'cpp,csharp,go,java,javascript,python,ruby' || '' }} tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - if: runner.os == 'macOS' - with: - codeql-path: ${{ steps.init.outputs.codeql-path }} - - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/rubocop-multi-language.yml b/pr-checks/checks/rubocop-multi-language.yml index 128a0abfb..bceef99dd 100644 --- a/pr-checks/checks/rubocop-multi-language.yml +++ b/pr-checks/checks/rubocop-multi-language.yml @@ -5,7 +5,7 @@ operatingSystems: ["ubuntu"] versions: ["default"] steps: - name: Set up Ruby - uses: ruby/setup-ruby@829114fc20da43a41d27359103ec7a63020954d4 # v1.255.0 + uses: ruby/setup-ruby@efbf473cab83af4468e8606cc33eca9281bb213f # v1.256.0 with: ruby-version: 2.6 - name: Install Code Scanning integration diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 9e3a39f34..d7575035f 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -9,9 +9,6 @@ steps: languages: swift build-mode: autobuild tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - with: - codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory shell: bash run: pwd diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index a66d0a5a4..dc45c56b3 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,14 +6,15 @@ installGo: true env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - name: Use Xcode 16 + shell: bash + if: runner.os == 'macOS' && matrix.version != 'nightly-latest' + run: sudo xcode-select -s "/Applications/Xcode_16.app" - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/.github/actions/setup-swift - with: - codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory shell: bash run: pwd diff --git a/pr-checks/sync.py b/pr-checks/sync.py index 25518d319..beaa94398 100755 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -175,7 +175,7 @@ for file in sorted((this_dir / 'checks').glob('*.yml')): steps.append({ 'name': 'Install Java', - 'uses': 'actions/setup-java@v4', + 'uses': 'actions/setup-java@v5', 'with': { 'java-version': '${{ inputs.java-version || \'' + baseJavaVersionExpr + '\' }}', 'distribution': 'temurin' diff --git a/src/analyses.test.ts b/src/analyses.test.ts new file mode 100644 index 000000000..2c314c2c1 --- /dev/null +++ b/src/analyses.test.ts @@ -0,0 +1,36 @@ +import test from "ava"; + +import { + AnalysisKind, + parseAnalysisKinds, + supportedAnalysisKinds, +} from "./analyses"; +import { ConfigurationError } from "./util"; + +test("All known analysis kinds can be parsed successfully", async (t) => { + for (const analysisKind of supportedAnalysisKinds) { + t.deepEqual(await parseAnalysisKinds(analysisKind), [analysisKind]); + } +}); + +test("Parsing analysis kinds returns unique results", async (t) => { + const analysisKinds = await parseAnalysisKinds( + "code-scanning,code-quality,code-scanning", + ); + t.deepEqual(analysisKinds, [ + AnalysisKind.CodeScanning, + AnalysisKind.CodeQuality, + ]); +}); + +test("Parsing an unknown analysis kind fails with a configuration error", async (t) => { + await t.throwsAsync(parseAnalysisKinds("code-scanning,foo"), { + instanceOf: ConfigurationError, + }); +}); + +test("Parsing analysis kinds requires at least one analysis kind", async (t) => { + await t.throwsAsync(parseAnalysisKinds(","), { + instanceOf: ConfigurationError, + }); +}); diff --git a/src/analyses.ts b/src/analyses.ts new file mode 100644 index 000000000..3ef85745f --- /dev/null +++ b/src/analyses.ts @@ -0,0 +1,40 @@ +import { ConfigurationError } from "./util"; + +export enum AnalysisKind { + CodeScanning = "code-scanning", + CodeQuality = "code-quality", +} + +// Exported for testing. A set of all known analysis kinds. +export const supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); + +/** + * Parses a comma-separated string into a list of unique analysis kinds. + * Throws a configuration error if the input contains unknown analysis kinds + * or doesn't contain at least one element. + * + * @param input The comma-separated string to parse. + * @returns The array of unique analysis kinds that were parsed from the input string. + */ +export async function parseAnalysisKinds( + input: string, +): Promise { + const components = input.split(","); + + if (components.length < 1) { + throw new ConfigurationError( + "At least one analysis kind must be configured.", + ); + } + + for (const component of components) { + if (!supportedAnalysisKinds.has(component as AnalysisKind)) { + throw new ConfigurationError(`Unknown analysis kind: ${component}`); + } + } + + // Return all unique elements. + return Array.from( + new Set(components.map((component) => component as AnalysisKind)), + ); +} diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 090ebe153..87af6fcca 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -18,7 +18,7 @@ import { getApiDetails, getGitHubVersion } from "./api-client"; import { runAutobuild } from "./autobuild"; import { getTotalCacheSize, shouldStoreCache } from "./caching-utils"; import { getCodeQL } from "./codeql"; -import { Config, getConfig } from "./config-utils"; +import { Config, getConfig, isCodeQualityEnabled } from "./config-utils"; import { uploadDatabases } from "./database-upload"; import { uploadDependencyCaches } from "./dependency-caching"; import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils"; @@ -336,7 +336,7 @@ async function run() { ); core.setOutput("sarif-id", uploadResult.sarifID); - if (config.augmentationProperties.qualityQueriesInput !== undefined) { + if (isCodeQualityEnabled(config)) { const qualityUploadResult = await uploadLib.uploadFiles( outputDir, actionsUtil.getRequiredInput("checkout_path"), diff --git a/src/analyze.ts b/src/analyze.ts index b66620f1b..dad12d78c 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -662,7 +662,7 @@ export async function runQueries( const sarifFile = path.join(sarifFolder, `${language}.sarif`); const queries: string[] = []; - if (config.augmentationProperties.qualityQueriesInput !== undefined) { + if (configUtils.isCodeQualityEnabled(config)) { queries.push(util.getGeneratedSuitePath(config, language)); for (const qualityQuery of config.augmentationProperties .qualityQueriesInput) { @@ -695,7 +695,7 @@ export async function runQueries( ); let qualityAnalysisSummary: string | undefined; - if (config.augmentationProperties.qualityQueriesInput !== undefined) { + if (configUtils.isCodeQualityEnabled(config)) { logger.info(`Interpreting quality results for ${language}`); const qualityCategory = fixCodeQualityCategory( logger, diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 7f8df74ef..607e73217 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -7,6 +7,7 @@ import * as yaml from "js-yaml"; import * as sinon from "sinon"; import * as actionsUtil from "./actions-util"; +import { AnalysisKind } from "./analyses"; import * as api from "./api-client"; import { CachingKind } from "./caching-utils"; import { createStubCodeQL } from "./codeql"; @@ -47,6 +48,7 @@ function createTestInitConfigInputs( return Object.assign( {}, { + analysisKindsInput: "code-scanning", languagesInput: undefined, queriesInput: undefined, qualityQueriesInput: undefined, @@ -322,6 +324,7 @@ test("load non-empty input", async (t) => { // And the config we expect it to parse to const expectedConfig: configUtils.Config = { + analysisKinds: [AnalysisKind.CodeScanning], languages: [KnownLanguage.javascript], buildMode: BuildMode.None, originalUserInput: { diff --git a/src/config-utils.ts b/src/config-utils.ts index b7a4424dc..1cedf556c 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -6,6 +6,7 @@ import * as yaml from "js-yaml"; import * as semver from "semver"; import { isAnalyzingPullRequest } from "./actions-util"; +import { AnalysisKind, parseAnalysisKinds } from "./analyses"; import * as api from "./api-client"; import { CachingKind, getCachingKind } from "./caching-utils"; import { type CodeQL } from "./codeql"; @@ -93,6 +94,10 @@ interface IncludeQueryFilter { * Format of the parsed config file. */ export interface Config { + /** + * Set of analysis kinds that are enabled. + */ + analysisKinds: AnalysisKind[]; /** * Set of languages to run analysis for. */ @@ -483,6 +488,7 @@ export async function getRawLanguages( /** Inputs required to initialize a configuration. */ export interface InitConfigInputs { + analysisKindsInput: string; languagesInput: string | undefined; queriesInput: string | undefined; qualityQueriesInput: string | undefined; @@ -511,6 +517,7 @@ export interface InitConfigInputs { * Get the default config, populated without user configuration file. */ export async function getDefaultConfig({ + analysisKindsInput, languagesInput, queriesInput, qualityQueriesInput, @@ -530,6 +537,18 @@ export async function getDefaultConfig({ features, logger, }: InitConfigInputs): Promise { + const analysisKinds = await parseAnalysisKinds(analysisKindsInput); + + // For backwards compatibility, add Code Quality to the enabled analysis kinds + // if an input to `quality-queries` was specified. We should remove this once + // `quality-queries` is no longer used. + if ( + !analysisKinds.includes(AnalysisKind.CodeQuality) && + qualityQueriesInput !== undefined + ) { + analysisKinds.push(AnalysisKind.CodeQuality); + } + const languages = await getLanguages( codeql, languagesInput, @@ -560,6 +579,7 @@ export async function getDefaultConfig({ ); return { + analysisKinds, languages, buildMode, originalUserInput: {}, @@ -1468,3 +1488,12 @@ export function generateCodeScanningConfig( } return augmentedConfig; } + +/** + * Returns `true` if Code Quality analysis is enabled, or `false` if not. + */ +export function isCodeQualityEnabled(config: Config): config is Config & { + augmentationProperties: { qualityQueriesInput: string }; +} { + return config.analysisKinds.includes(AnalysisKind.CodeQuality); +} diff --git a/src/init-action.ts b/src/init-action.ts index 1d0106f74..04c6bafe1 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -385,6 +385,7 @@ async function run() { } config = await initConfig({ + analysisKindsInput: getRequiredInput("analysis-kinds"), languagesInput: getOptionalInput("languages"), queriesInput: getOptionalInput("queries"), qualityQueriesInput: getOptionalInput("quality-queries"), diff --git a/src/status-report.ts b/src/status-report.ts index 80b022b5b..e75698e9e 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -91,6 +91,8 @@ export interface StatusReportBase { action_version: string; /** The name of the Actions event that triggered the workflow. */ actions_event_name?: string; + /** Comma-separated list of the kinds of analyses we are performing. */ + analysis_kinds?: string; /** Analysis key, normally composed from the workflow path and job name. */ analysis_key: string; /** Build mode, if specified. */ @@ -293,6 +295,7 @@ export async function createStatusReportBase( action_ref: actionRef, action_started_at: actionStartedAt.toISOString(), action_version: getActionVersion(), + analysis_kinds: config?.analysisKinds.join(","), analysis_key, build_mode: config?.buildMode, commit_oid: commitOid, diff --git a/src/testing-utils.ts b/src/testing-utils.ts index d7d486bd5..932608ba7 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -6,6 +6,7 @@ import { TestFn } from "ava"; import nock from "nock"; import * as sinon from "sinon"; +import { AnalysisKind } from "./analyses"; import * as apiClient from "./api-client"; import { GitHubApiDetails } from "./api-client"; import * as codeql from "./codeql"; @@ -353,6 +354,7 @@ export function createTestConfig(overrides: Partial): Config { return Object.assign( {}, { + analysisKinds: [AnalysisKind.CodeScanning], languages: [], buildMode: undefined, originalUserInput: {},