diff --git a/.github/workflows/__config-input.yml b/.github/workflows/__config-input.yml index a5da2050a..7dbaed852 100644 --- a/.github/workflows/__config-input.yml +++ b/.github/workflows/__config-input.yml @@ -47,7 +47,7 @@ jobs: - name: Check out repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20.x cache: npm diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index adfbf27df..42c3ff95e 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -80,7 +80,7 @@ jobs: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20.x cache: npm diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 0e3c0a19f..717f4f0b9 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -80,7 +80,7 @@ jobs: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20.x cache: npm diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index 0d78c4727..2b5992224 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -80,7 +80,7 @@ jobs: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20.x cache: npm diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 981d3606b..7c8da5b3d 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -80,7 +80,7 @@ jobs: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 20.x cache: npm diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index 08f667d7c..7ee8f1fdc 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -54,7 +54,7 @@ jobs: use-all-platform-bundle: 'false' setup-kotlin: 'true' - name: Set up Ruby - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 + uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 with: ruby-version: 2.6 - name: Install Code Scanning integration diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml index 693be1239..ee1ecea3d 100644 --- a/.github/workflows/codescanning-config-cli.yml +++ b/.github/workflows/codescanning-config-cli.yml @@ -57,7 +57,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: 'npm' diff --git a/.github/workflows/post-release-mergeback.yml b/.github/workflows/post-release-mergeback.yml index b0eed4b71..0050c5da8 100644 --- a/.github/workflows/post-release-mergeback.yml +++ b/.github/workflows/post-release-mergeback.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: fetch-depth: 0 # ensure we have all tags and can push commits - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: 'npm' diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 45d38d345..ae2170782 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ matrix.node-version }} cache: 'npm' @@ -91,7 +91,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: 'npm' diff --git a/.github/workflows/query-filters.yml b/.github/workflows/query-filters.yml index 0343ce2e6..182b64b9c 100644 --- a/.github/workflows/query-filters.yml +++ b/.github/workflows/query-filters.yml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Install Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: npm diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index 39b42d8a0..f1d2a1a4f 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -30,7 +30,7 @@ jobs: ref: ${{ env.HEAD_REF }} - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: 'npm' diff --git a/.github/workflows/update-bundle.yml b/.github/workflows/update-bundle.yml index 04402f6db..f5e79075e 100644 --- a/.github/workflows/update-bundle.yml +++ b/.github/workflows/update-bundle.yml @@ -46,7 +46,7 @@ jobs: python-version: '3.12' - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: 'npm' diff --git a/.github/workflows/update-supported-enterprise-server-versions.yml b/.github/workflows/update-supported-enterprise-server-versions.yml index ed35ff9ca..30f926d7a 100644 --- a/.github/workflows/update-supported-enterprise-server-versions.yml +++ b/.github/workflows/update-supported-enterprise-server-versions.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Node.js - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 cache: 'npm' diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f0ec6ed..3704761f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th ## [UNRELEASED] - _Upcoming breaking change_: Add a deprecation warning for customers using CodeQL version 2.20.6 and earlier. These versions of CodeQL were discontinued on 1 July 2026 alongside GitHub Enterprise Server 3.16, and will be unsupported by the next minor release of the CodeQL Action. [#3956](https://github.com/github/codeql-action/pull/3956) +- Update default CodeQL bundle version to [2.26.1](https://github.com/github/codeql-action/releases/tag/codeql-bundle-v2.26.1). [#4019](https://github.com/github/codeql-action/pull/4019) ## 4.37.0 - 08 Jul 2026 diff --git a/lib/defaults.json b/lib/defaults.json index 660296139..39ecfc35f 100644 --- a/lib/defaults.json +++ b/lib/defaults.json @@ -1,6 +1,6 @@ { - "bundleVersion": "codeql-bundle-v2.26.0", - "cliVersion": "2.26.0", - "priorBundleVersion": "codeql-bundle-v2.25.6", - "priorCliVersion": "2.25.6" + "bundleVersion": "codeql-bundle-v2.26.1", + "cliVersion": "2.26.1", + "priorBundleVersion": "codeql-bundle-v2.26.0", + "priorCliVersion": "2.26.0" } diff --git a/lib/entry-points.js b/lib/entry-points.js index 4bd24e058..760b1caac 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -142053,17 +142053,37 @@ var seqTag = defineSequenceTag("tag:yaml.org,2002:seq", { }, identify: Array.isArray }); +function isPlainObject3(data) { + if (data === null || typeof data !== "object" || Array.isArray(data)) return false; + const prototype = Object.getPrototypeOf(data); + return prototype === null || prototype === Object.prototype; +} +function pick(object2, keys) { + const result = {}; + for (const key of keys) if (object2[key] !== void 0) result[key] = object2[key]; + return result; +} var omapTag = defineSequenceTag("tag:yaml.org,2002:omap", { - create: () => [], - addItem: (container, item) => { - if (Object.prototype.toString.call(item) !== "[object Object]") return "cannot resolve an ordered map item"; - const object2 = item; - const itemKeys = Object.keys(object2); - if (itemKeys.length !== 1) return "cannot resolve an ordered map item"; - for (const existing of container) if (Object.prototype.hasOwnProperty.call(existing, itemKeys[0])) return "cannot resolve an ordered map item"; - container.push(object2); + create: () => ({ + list: [], + seen: /* @__PURE__ */ new Set() + }), + addItem: (carrier, item) => { + let key; + if (item instanceof Map) { + if (item.size !== 1) return "cannot resolve an ordered map item"; + key = item.keys().next().value; + } else if (isPlainObject3(item)) { + const itemKeys = Object.keys(item); + if (itemKeys.length !== 1) return "cannot resolve an ordered map item"; + key = itemKeys[0]; + } else return "cannot resolve an ordered map item"; + if (carrier.seen.has(key)) return "duplicate key in ordered map"; + carrier.seen.add(key); + carrier.list.push(item); return ""; - } + }, + finalize: (carrier) => carrier.list }); var pairsTag = defineSequenceTag("tag:yaml.org,2002:pairs", { create: () => [], @@ -142081,16 +142101,6 @@ var pairsTag = defineSequenceTag("tag:yaml.org,2002:pairs", { return ""; } }); -function isPlainObject3(data) { - if (data === null || typeof data !== "object" || Array.isArray(data)) return false; - const prototype = Object.getPrototypeOf(data); - return prototype === null || prototype === Object.prototype; -} -function pick(object2, keys) { - const result = {}; - for (const key of keys) if (object2[key] !== void 0) result[key] = object2[key]; - return result; -} var mapTag = defineMappingTag("tag:yaml.org,2002:map", { create: () => ({}), identify: isPlainObject3, @@ -146556,8 +146566,8 @@ var path5 = __toESM(require("path")); var semver4 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.26.0"; -var cliVersion = "2.26.0"; +var bundleVersion = "codeql-bundle-v2.26.1"; +var cliVersion = "2.26.1"; // src/overlay/index.ts var fs4 = __toESM(require("fs")); @@ -147818,13 +147828,16 @@ function flushDiagnostics(config) { unwrittenDiagnostics = []; unwrittenDefaultLanguageDiagnostics = []; } -function makeTelemetryDiagnostic(id, name, attributes) { +function makeTelemetryDiagnostic(id, name, attributes, tags) { return makeDiagnostic(id, name, { attributes, visibility: { cliSummaryTable: false, statusPage: false, telemetry: true + }, + source: { + tags } }); } @@ -148026,7 +148039,8 @@ function mergeDefaultSetupAndUserConfigs(logger, fromConfigInput, fromConfigFile "Invalid Default Setup configuration keys", { invalidKeys: schemaCheckResult.invalidKeys - } + }, + ["internal-error"] ) ); } @@ -148041,7 +148055,8 @@ function mergeDefaultSetupAndUserConfigs(logger, fromConfigInput, fromConfigFile "Unrecognised Default Setup configuration keys", { unrecognisedKeys: schemaCheckResult.unknownKeys - } + }, + ["internal-error"] ) ); } @@ -163003,7 +163018,7 @@ tmp/lib/tmp.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 5.2.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT *) long/index.js: (** diff --git a/package-lock.json b/package-lock.json index 7acded671..f2f8f4909 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,13 +22,16 @@ "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^3.0.1", + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": "^14.0.0", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "@octokit/plugin-retry": "^8.1.0", "archiver": "^8.0.0", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.16.0", "get-folder-size": "^5.0.0", "https-proxy-agent": "^7.0.6", - "js-yaml": "^5.2.0", + "js-yaml": "^5.2.1", "jsonschema": "1.5.0", "long": "^5.3.2", "node-forge": "^1.4.0", @@ -53,7 +56,7 @@ "esbuild": "^0.28.1", "eslint": "^9.39.4", "eslint-import-resolver-typescript": "^4.4.5", - "eslint-plugin-github": "^6.0.0", + "eslint-plugin-github": "^6.1.0", "eslint-plugin-import-x": "^4.17.1", "eslint-plugin-jsdoc": "^62.9.0", "eslint-plugin-no-async-foreach": "^0.1.1", @@ -62,7 +65,7 @@ "nock": "^14.0.16", "sinon": "^22.0.0", "typescript": "^6.0.3", - "typescript-eslint": "^8.62.1" + "typescript-eslint": "^8.63.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -2588,17 +2591,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.62.1.tgz", - "integrity": "sha512-4EQM77WgVNxj7OkL/5b/D/xZsw00G577+UriYTC7JF5opcF3T2AuoeY7ueLaZgSVjSgCS6yOAJB5bRGLPSJUzA==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz", + "integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.62.1", - "@typescript-eslint/type-utils": "8.62.1", - "@typescript-eslint/utils": "8.62.1", - "@typescript-eslint/visitor-keys": "8.62.1", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/type-utils": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -2611,7 +2614,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.62.1", + "@typescript-eslint/parser": "^8.63.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } @@ -2627,16 +2630,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.62.1.tgz", - "integrity": "sha512-sPhE4iHuJDSvoAiec+Ro8JyXw8f0ql13HFR82P99nCm9GwTEKG0KYLvDe6REk8BCXuit6vJAv/Yxg5ABaNS2rA==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz", + "integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.62.1", - "@typescript-eslint/types": "8.62.1", - "@typescript-eslint/typescript-estree": "8.62.1", - "@typescript-eslint/visitor-keys": "8.62.1", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", "debug": "^4.4.3" }, "engines": { @@ -2670,14 +2673,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.62.1.tgz", - "integrity": "sha512-yQ3RgY5RkSBpsNS1Bx/JQEcA24FOSdfGktoyprAr5u18390UQdtVcfnEv4nIrIshNnavlVyZBKxQwT1fIAE6cg==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz", + "integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.62.1", - "@typescript-eslint/types": "^8.62.1", + "@typescript-eslint/tsconfig-utils": "^8.63.0", + "@typescript-eslint/types": "^8.63.0", "debug": "^4.4.3" }, "engines": { @@ -2710,14 +2713,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.62.1.tgz", - "integrity": "sha512-r4d249KbQ1SFdpeStvob8Ih6aPPIzfqllPVOtvhve6ZcpuVcYo5/7zUWckKpHE7StASX4kTKZTLf0WQm/wPkcg==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz", + "integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.62.1", - "@typescript-eslint/visitor-keys": "8.62.1" + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2728,9 +2731,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.62.1.tgz", - "integrity": "sha512-xadytJqX9vJVQ2fdQjkcIVigwaOJNWkpjdLt6cEQ+xPnrI1fkp+/jZE/I97k9KUjqtpd25i0HeyZf3T6dutv2g==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz", + "integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==", "dev": true, "license": "MIT", "engines": { @@ -2745,15 +2748,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.62.1.tgz", - "integrity": "sha512-aXM5xlqXiTxPibXB93cLAURfT3rlizf7uMXISCXy66Isr/9hISJx3yDsKl0L7lKa51b8JpFuNKby0/O0pEm9jg==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz", + "integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.62.1", - "@typescript-eslint/typescript-estree": "8.62.1", - "@typescript-eslint/utils": "8.62.1", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -2788,9 +2791,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.62.1.tgz", - "integrity": "sha512-ooCzJFaf+Hg+uG6fA3NRFGuFjlfNlDhBthbv4ZPU/0elCAFUfnyXUvf/WOpHz/jYwSmvU2GkR2LtyUfy1AxZ1Q==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz", + "integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==", "dev": true, "license": "MIT", "engines": { @@ -2802,16 +2805,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.62.1.tgz", - "integrity": "sha512-xMcW9oP9u7fAMXYs9A65CVmtLQe2r//oXINHfi8HV+oiqhih17sbLdhXr4540YWlgpDKQdY854OL5ZrdCiQsAA==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz", + "integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.62.1", - "@typescript-eslint/tsconfig-utils": "8.62.1", - "@typescript-eslint/types": "8.62.1", - "@typescript-eslint/visitor-keys": "8.62.1", + "@typescript-eslint/project-service": "8.63.0", + "@typescript-eslint/tsconfig-utils": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -2887,16 +2890,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.62.1.tgz", - "integrity": "sha512-sHtbPfuKNZCG+ih8SyjjucqRntSVmp8XgL5u6o9mAhiSn8ds5o/M/XdM0abweme2Tln3szOstOrZ9OXitvPh0g==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz", + "integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.62.1", - "@typescript-eslint/types": "8.62.1", - "@typescript-eslint/typescript-estree": "8.62.1" + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2911,13 +2914,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.62.1.tgz", - "integrity": "sha512-4g3BLxfdTMy8iZG0MaBkadnlRrCJ74cQiFbyEVMrkwIoqdyaXXQM22cotDvrl4x28wgIZ9rEJRoM+mmhSJpJ1g==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz", + "integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.62.1", + "@typescript-eslint/types": "8.63.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -4985,13 +4988,13 @@ } }, "node_modules/eslint-plugin-github": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-6.0.0.tgz", - "integrity": "sha512-J8MvUoiR/TU/Y9NnEmg1AnbvMUj9R6IO260z47zymMLLvso7B4c80IKjd8diqmqtSmeXXlbIus4i0SvK84flag==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-6.1.0.tgz", + "integrity": "sha512-+mA0K1/I1JSE9AOiJ4ifMDGu7NplRZX0e3Uy0SjbwyXb2rsDfo5yfT0UCUO+TiOJ/99R1YxFRltizP/PZuB4PQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint/compat": "^1.2.3", + "@eslint/compat": "^2.0.0", "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.14.0", "@github/browserslist-config": "^1.0.0", @@ -5008,79 +5011,18 @@ "eslint-plugin-no-only-tests": "^3.0.0", "eslint-plugin-prettier": "^5.2.1", "eslint-rule-documentation": ">=1.0.0", - "globals": "^16.0.0", + "globals": "^17.7.0", "jsx-ast-utils": "^3.3.2", "prettier": "^3.0.0", "svg-element-attributes": "^1.3.1", - "typescript": "^5.7.3", + "typescript": "^6.0.3", "typescript-eslint": "^8.14.0" }, "bin": { "eslint-ignore-errors": "bin/eslint-ignore-errors.js" }, "peerDependencies": { - "eslint": "^8 || ^9" - } - }, - "node_modules/eslint-plugin-github/node_modules/@eslint/compat": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.4.1.tgz", - "integrity": "sha512-cfO82V9zxxGBxcQDr1lfaYB7wykTa0b00mGa36FrJl7iTFd0Z2cHfEYuxcBRP/iNijCsWsEkA+jzT8hGYmv33w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@eslint/core": "^0.17.0" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "peerDependencies": { - "eslint": "^8.40 || 9" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-plugin-github/node_modules/@eslint/core": { - "version": "0.17.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", - "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/eslint-plugin-github/node_modules/globals": { - "version": "16.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", - "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint-plugin-github/node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" + "eslint": "^8 || ^9 || ^10" } }, "node_modules/eslint-plugin-i18n-text": { @@ -6979,9 +6921,9 @@ } }, "node_modules/js-yaml": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.0.tgz", - "integrity": "sha512-YeLUMlvR4Ou1B119LIaM0r65JvbOBooJDc9yEu0dClb/uSC5P4FrLU8OCCz/HXWvtPoIrR0dRzABTjo1sTN9Bw==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.2.1.tgz", + "integrity": "sha512-zfLtNfQqxVqq3uaTqSkh4x4hZw3KHobGUA0fJUj4wawW8bsQLTVqpHdXSIzidh7o+4lEW36tANuAGdaFx6Zgnw==", "funding": [ { "type": "github", @@ -9166,9 +9108,9 @@ "license": "0BSD" }, "node_modules/tsx": { - "version": "4.22.4", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.22.4.tgz", - "integrity": "sha512-X8EX+XV4QR5xCsrgxaED954zTDfY8KqlDtskKEL0cHhyS/P8b4IFOvGDQpsC9Q1XnLq915wEfwwY/zzskCtmhg==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.0.tgz", + "integrity": "sha512-eUdUIaCr963q2h5u3+QwvYp0+eqPvn+egeqZUm0hwERCqqx1E3kK5ehbGCvqSE5MQAULr67ww0cA3jKc3YkM1w==", "dev": true, "license": "MIT", "dependencies": { @@ -9318,16 +9260,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.62.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.62.1.tgz", - "integrity": "sha512-vymnnM5g0AKQDSAyfP12nMIBvgwgA42syg74kkuZ4x1VuTzwQKwc5h9rGxeShCjny5o+zWAb6OEoz7XLgrIkIw==", + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.63.0.tgz", + "integrity": "sha512-xgwXyzG4sK9ALkBxbyGkTMMOS+imnW65iPhxCQMK83KhxyoDNW7l+IDqEf9vMdoUidHpOoS967RCq4eMiTexwQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.62.1", - "@typescript-eslint/parser": "8.62.1", - "@typescript-eslint/typescript-estree": "8.62.1", - "@typescript-eslint/utils": "8.62.1" + "@typescript-eslint/eslint-plugin": "8.63.0", + "@typescript-eslint/parser": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -9815,7 +9757,7 @@ }, "devDependencies": { "@types/node": "^20.19.43", - "tsx": "^4.22.4" + "tsx": "^4.23.0" } } } diff --git a/package.json b/package.json index e979911d3..c2f74b1a8 100644 --- a/package.json +++ b/package.json @@ -30,13 +30,16 @@ "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^3.0.1", + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": "^14.0.0", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "@octokit/plugin-retry": "^8.1.0", "archiver": "^8.0.0", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.16.0", "get-folder-size": "^5.0.0", "https-proxy-agent": "^7.0.6", - "js-yaml": "^5.2.0", + "js-yaml": "^5.2.1", "jsonschema": "1.5.0", "long": "^5.3.2", "node-forge": "^1.4.0", @@ -61,7 +64,7 @@ "esbuild": "^0.28.1", "eslint": "^9.39.4", "eslint-import-resolver-typescript": "^4.4.5", - "eslint-plugin-github": "^6.0.0", + "eslint-plugin-github": "^6.1.0", "eslint-plugin-import-x": "^4.17.1", "eslint-plugin-jsdoc": "^62.9.0", "eslint-plugin-no-async-foreach": "^0.1.1", @@ -70,7 +73,7 @@ "nock": "^14.0.16", "sinon": "^22.0.0", "typescript": "^6.0.3", - "typescript-eslint": "^8.62.1" + "typescript-eslint": "^8.63.0" }, "overrides": { "@actions/tool-cache": { diff --git a/pr-checks/checks/rubocop-multi-language.yml b/pr-checks/checks/rubocop-multi-language.yml index faec4fe21..4128c446d 100644 --- a/pr-checks/checks/rubocop-multi-language.yml +++ b/pr-checks/checks/rubocop-multi-language.yml @@ -5,7 +5,7 @@ versions: - default steps: - name: Set up Ruby - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 + uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 with: ruby-version: 2.6 - name: Install Code Scanning integration diff --git a/pr-checks/package.json b/pr-checks/package.json index e5a119ff1..63bfa3ddf 100644 --- a/pr-checks/package.json +++ b/pr-checks/package.json @@ -12,6 +12,6 @@ }, "devDependencies": { "@types/node": "^20.19.43", - "tsx": "^4.22.4" + "tsx": "^4.23.0" } } diff --git a/pr-checks/sync.ts b/pr-checks/sync.ts index f3520449e..4329fc01e 100755 --- a/pr-checks/sync.ts +++ b/pr-checks/sync.ts @@ -211,8 +211,8 @@ const languageSetups: LanguageSetups = { name: "Install Node.js", uses: pinnedUses( "actions/setup-node", - "48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e", - "v6.4.0", + "820762786026740c76f36085b0efc47a31fe5020", + "v7.0.0", ), with: { "node-version": defaultLanguageVersions.javascript, diff --git a/src/action-common.ts b/src/action-common.ts index dc76e9fdb..cbb1cd342 100644 --- a/src/action-common.ts +++ b/src/action-common.ts @@ -1,8 +1,9 @@ import * as core from "@actions/core"; import { ActionsEnv, getActionsEnv } from "./actions-util"; -import { Env } from "./environment"; -import { FeatureEnablement } from "./feature-flags"; +import type { ApiClient } from "./api-client"; +import { Env, ReadOnlyEnv } from "./environment"; +import type { FeatureEnablement } from "./feature-flags"; import { getActionsLogger, Logger } from "./logging"; import { ActionName, @@ -11,7 +12,7 @@ import { } from "./status-report"; import { getEnv, getErrorMessage } from "./util"; -/** Common state that is always available in `ActionState`. */ +/** Base state that is available to an Action on startup. */ export interface BaseState { /** The name of the Action. */ name: ActionName; @@ -21,6 +22,7 @@ export interface BaseState { /** Describes different state features that an Action may have. */ export interface FeatureState { + Base: BaseState; Logger: { /** The logger that is in use. */ logger: Logger; @@ -29,10 +31,17 @@ export interface FeatureState { /** Information about environment variables. */ env: Env; }; + ReadOnlyEnv: { + env: ReadOnlyEnv; + }; Actions: { /** Access to Actions-related functionality. */ actions: ActionsEnv; }; + Api: { + /** A GitHub API client. */ + apiClient: ApiClient; + }; FeatureFlags: { /** Information about enabled feature flags. */ features: FeatureEnablement; @@ -44,7 +53,7 @@ export type StateFeature = keyof FeatureState; /** Constructs the intersection of all state types identifies by `Fs`. */ export type FieldsOf = Fs extends [] - ? BaseState + ? Record : Fs extends [ infer Head extends StateFeature, ...infer Tail extends readonly StateFeature[], @@ -60,7 +69,7 @@ export type ActionState = FieldsOf; * Each Action can then augment the `state` further if additional features are required. */ export type ActionMain = ( - state: ActionState<["Logger", "Env", "Actions"]>, + state: ActionState<["Base", "Logger", "Env", "Actions"]>, ) => Promise; /** A specification for a CodeQL Action step. */ diff --git a/src/analyze-action.ts b/src/analyze-action.ts index f7cbbaabe..5104719bc 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -212,7 +212,7 @@ async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) { await runAutobuild(config, BuiltInLanguage.go, logger); } -async function run({ startedAt, logger }: ActionState<["Logger"]>) { +async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) { // To capture errors appropriately, keep as much code within the try-catch as // possible, and only use safe functions outside. diff --git a/src/api-client.ts b/src/api-client.ts index 3782bc2cf..48de34d8d 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -1,5 +1,8 @@ import * as core from "@actions/core"; import * as githubUtils from "@actions/github/lib/utils"; +import { type Octokit } from "@octokit/core"; +import { type PaginateInterface } from "@octokit/plugin-paginate-rest"; +import { type Api } from "@octokit/plugin-rest-endpoint-methods"; import * as retry from "@octokit/plugin-retry"; import { RequestRequestOptions } from "@octokit/types"; import { @@ -122,6 +125,10 @@ export function getApiFetch( return proxiedFetch; } +/** The type of GitHub API client we use. */ +export type ApiClient = Octokit & Api & { paginate: PaginateInterface }; + +/** Options for `createApiClientWithDetails`. */ interface CreateApiClientOptions { allowExternal?: boolean; proxy?: ProxyAgent; @@ -130,7 +137,7 @@ interface CreateApiClientOptions { function createApiClientWithDetails( apiDetails: GitHubApiCombinedDetails, { allowExternal = false, proxy = undefined }: CreateApiClientOptions = {}, -) { +): ApiClient { const auth = (allowExternal && apiDetails.externalRepoAuth) || apiDetails.auth; const retryingOctokit = githubUtils.GitHub.plugin(retry.retry); diff --git a/src/autobuild-action.ts b/src/autobuild-action.ts index afda0e236..b78bffb9d 100644 --- a/src/autobuild-action.ts +++ b/src/autobuild-action.ts @@ -68,7 +68,7 @@ async function sendCompletedStatusReport( } } -async function run({ startedAt, logger }: ActionState<["Logger"]>) { +async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) { // To capture errors appropriately, keep as much code within the try-catch as // possible, and only use safe functions outside. diff --git a/src/config/db-config.ts b/src/config/db-config.ts index 582cfe8af..7b5bdbd8c 100644 --- a/src/config/db-config.ts +++ b/src/config/db-config.ts @@ -125,6 +125,7 @@ export function mergeDefaultSetupAndUserConfigs( { invalidKeys: schemaCheckResult.invalidKeys, }, + ["internal-error"], ), ); } @@ -140,6 +141,7 @@ export function mergeDefaultSetupAndUserConfigs( { unrecognisedKeys: schemaCheckResult.unknownKeys, }, + ["internal-error"], ), ); } diff --git a/src/defaults.json b/src/defaults.json index 660296139..39ecfc35f 100644 --- a/src/defaults.json +++ b/src/defaults.json @@ -1,6 +1,6 @@ { - "bundleVersion": "codeql-bundle-v2.26.0", - "cliVersion": "2.26.0", - "priorBundleVersion": "codeql-bundle-v2.25.6", - "priorCliVersion": "2.25.6" + "bundleVersion": "codeql-bundle-v2.26.1", + "cliVersion": "2.26.1", + "priorBundleVersion": "codeql-bundle-v2.26.0", + "priorCliVersion": "2.26.0" } diff --git a/src/diagnostics.ts b/src/diagnostics.ts index 65e82ce1a..fa0e87c04 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -6,24 +6,45 @@ import { Language } from "./languages"; import { getActionsLogger } from "./logging"; import { getCodeQLDatabasePath } from "./util"; -/** Represents a diagnostic message for the tool status page, etc. */ -export interface DiagnosticMessage { +/** + * Known tags for diagnostics. There is currently only "internal-error", + * but others may be added in the future. + */ +export type DiagnosticTag = "internal-error"; + +/** Optional information about the origin of a diagnostic. */ +export type DiagnosticSourceOptions = { + /** + * Name of the CodeQL extractor. This is used to identify which tool component the reporting + * descriptor object should be nested under in SARIF. + */ + extractorName?: string; + /** An array of tags for the diagnostic. */ + tags?: DiagnosticTag[]; +}; + +/** Represents information about the origin of a diagnostic. */ +export type DiagnosticSource = { + /** + * An identifier under which it makes sense to group this diagnostic message. + * This is used to build the SARIF reporting descriptor object. + */ + id: string; + /** Display name for the ID. This is used to build the SARIF reporting descriptor object. */ + name: string; +} & DiagnosticSourceOptions; + +/** + * Represents a diagnostic message for the tool status page, etc. + * + * Unlike {@link DiagnosticMessage}, properties which can automatically + * be populated are optional in this type. + */ +export type DiagnosticMessageOptions = { /** ISO 8601 timestamp */ - timestamp: string; - source: { - /** - * An identifier under which it makes sense to group this diagnostic message. - * This is used to build the SARIF reporting descriptor object. - */ - id: string; - /** Display name for the ID. This is used to build the SARIF reporting descriptor object. */ - name: string; - /** - * Name of the CodeQL extractor. This is used to identify which tool component the reporting - * descriptor object should be nested under in SARIF. - */ - extractorName?: string; - }; + timestamp?: string; + /** Information about the origin of the diagnostic. */ + source?: DiagnosticSourceOptions; /** GitHub flavored Markdown formatted message. Should include inline links to any help pages. */ markdownMessage?: string; /** Plain text message. Used by components where the string processing needed to support Markdown is cumbersome. */ @@ -53,7 +74,15 @@ export interface DiagnosticMessage { }; /** Structured metadata about the diagnostic message */ attributes?: { [key: string]: any }; -} +}; + +/** Represents a diagnostic message for the tool status page, etc. */ +export type DiagnosticMessage = DiagnosticMessageOptions & { + /** ISO 8601 timestamp */ + timestamp: string; + /** Information about the origin of the diagnostic. */ + source: DiagnosticSource; +}; /** Represents a diagnostic message that has not yet been written to the database. */ interface UnwrittenDiagnostic { @@ -90,7 +119,7 @@ let diagnosticCounter = 0; export function makeDiagnostic( id: string, name: string, - data: Partial | undefined = undefined, + data: DiagnosticMessageOptions | undefined = undefined, ): DiagnosticMessage { return { ...data, @@ -243,6 +272,7 @@ export function makeTelemetryDiagnostic( id: string, name: string, attributes: { [key: string]: any }, + tags?: DiagnosticTag[], ): DiagnosticMessage { return makeDiagnostic(id, name, { attributes, @@ -251,5 +281,8 @@ export function makeTelemetryDiagnostic( statusPage: false, telemetry: true, }, + source: { + tags, + }, }); } diff --git a/src/init-action.ts b/src/init-action.ts index acaba701b..8d0434160 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -203,7 +203,9 @@ async function sendCompletedStatusReport( } } -async function run(actionState: ActionState<["Logger", "Env", "Actions"]>) { +async function run( + actionState: ActionState<["Base", "Logger", "Env", "Actions"]>, +) { // To capture errors appropriately, keep as much code within the try-catch as // possible, and only use safe functions outside. diff --git a/src/setup-codeql-action.ts b/src/setup-codeql-action.ts index a6b5f83f5..3336afc1a 100644 --- a/src/setup-codeql-action.ts +++ b/src/setup-codeql-action.ts @@ -90,7 +90,7 @@ async function sendCompletedStatusReport( async function run({ startedAt, logger, -}: ActionState<["Logger"]>): Promise { +}: ActionState<["Base", "Logger"]>): Promise { // To capture errors appropriately, keep as much code within the try-catch as // possible, and only use safe functions outside. diff --git a/src/testing-utils.ts b/src/testing-utils.ts index f8272c3ff..f0a17c4ca 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -192,7 +192,15 @@ export function getTestActionsEnv(): ActionsEnv { } /** For testing purposes, we make all available state features accessible in `TestEnv`. */ -type AllState = ["Logger", "Env", "Actions", "FeatureFlags"]; +type AllState = [ + "Base", + "Logger", + "Env", + "ReadOnlyEnv", + "Actions", + "Api", + "FeatureFlags", +]; /** Initialise a fresh `ActionState` value. */ export function initAllState( @@ -204,6 +212,7 @@ export function initAllState( logger: new RecordingLogger(), env: getTestEnv(), actions: getTestActionsEnv(), + apiClient: github.getOctokit("123"), features: createFeatures([]), ...overrides, }; diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts index 214f3bf98..d3437510c 100644 --- a/src/upload-sarif-action.ts +++ b/src/upload-sarif-action.ts @@ -54,7 +54,7 @@ async function sendSuccessStatusReport( } } -async function run({ startedAt, logger }: ActionState<["Logger"]>) { +async function run({ startedAt, logger }: ActionState<["Base", "Logger"]>) { // To capture errors appropriately, keep as much code within the try-catch as // possible, and only use safe functions outside. try {