From 054745baee70380ac417ab0a61e1fc9df4940a53 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 12:50:06 +0000 Subject: [PATCH 01/30] Convert `release-branches.py` to TypeScript --- package-lock.json | 1 + pr-checks/config.ts | 2 + pr-checks/package.json | 1 + pr-checks/release-branches.ts | 71 +++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 pr-checks/config.ts create mode 100755 pr-checks/release-branches.ts diff --git a/package-lock.json b/package-lock.json index fdab827db2..c0ee6909b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9920,6 +9920,7 @@ "yaml": "^2.8.2" }, "devDependencies": { + "@actions/core": "*", "@types/node": "^20.19.9", "tsx": "^4.21.0", "typescript": "^5.9.3" diff --git a/pr-checks/config.ts b/pr-checks/config.ts new file mode 100644 index 0000000000..73001f13d5 --- /dev/null +++ b/pr-checks/config.ts @@ -0,0 +1,2 @@ +/** The oldest supported major version of the CodeQL Action. */ +export const OLDEST_SUPPORTED_MAJOR_VERSION = 3; diff --git a/pr-checks/package.json b/pr-checks/package.json index b323b98b83..7ec2fdc0fa 100644 --- a/pr-checks/package.json +++ b/pr-checks/package.json @@ -5,6 +5,7 @@ "yaml": "^2.8.2" }, "devDependencies": { + "@actions/core": "*", "@types/node": "^20.19.9", "tsx": "^4.21.0", "typescript": "^5.9.3" diff --git a/pr-checks/release-branches.ts b/pr-checks/release-branches.ts new file mode 100755 index 0000000000..03f5e5bc6d --- /dev/null +++ b/pr-checks/release-branches.ts @@ -0,0 +1,71 @@ +#!/usr/bin/env npx tsx + +import { parseArgs } from "node:util"; + +import * as core from "@actions/core"; + +import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; + +async function main() { + const { values: options } = parseArgs({ + options: { + // The major version of the release + "major-version": { + type: "string", + }, + // The most recent tag published to the repository + "latest-tag": { + type: "string", + }, + }, + strict: true, + }); + + if (options["major-version"] === undefined) { + throw Error("--major-version is required"); + } + if (options["latest-tag"] === undefined) { + throw Error("--latest-tag is required"); + } + + const majorVersion = Number.parseInt(options["major-version"].substring(1)); + const latestTag = options["latest-tag"]; + + console.log(`major_version: v${majorVersion}`); + console.log(`latest_tag: ${latestTag}`); + + // If this is a primary release, we backport to all supported branches, + // so we check whether the major_version taken from the package.json + // is greater than or equal to the latest tag pulled from the repo. + // For example... + // 'v1' >= 'v2' is False # we're operating from an older release branch and should not backport + // 'v2' >= 'v2' is True # the normal case where we're updating the current version + // 'v3' >= 'v2' is True # in this case we are making the first release of a new major version + const latestTagMajor = Number.parseInt(latestTag.split(".")[0].substring(1)); + const considerBackports = majorVersion >= latestTagMajor; + + core.setOutput("backport_source_branch", `releases/v${majorVersion}`); + + const backportTargetBranches: string[] = []; + + if (considerBackports) { + for (let i = latestTagMajor - 1; i > 0; i--) { + const branch_name = `releases/v${i}`; + if (i >= OLDEST_SUPPORTED_MAJOR_VERSION) { + backportTargetBranches.push(branch_name); + } + } + } + + core.setOutput( + "backport_target_branches", + JSON.stringify(backportTargetBranches), + ); + + process.exit(0); +} + +// Only call `main` if this script was run directly. +if (require.main === module) { + void main(); +} From aa2773169b686d51ae1ba1c39a71cea21ddf14ba Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 13:07:45 +0000 Subject: [PATCH 02/30] Install `node` in `release-initialise` action --- .github/actions/release-initialise/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/release-initialise/action.yml b/.github/actions/release-initialise/action.yml index c21772b149..2ff616ce4c 100644 --- a/.github/actions/release-initialise/action.yml +++ b/.github/actions/release-initialise/action.yml @@ -15,6 +15,12 @@ runs: run: echo "$GITHUB_CONTEXT" shell: bash + - name: Set up Node + uses: actions/setup-node@v6 + with: + node-version: 20 + cache: 'npm' + - name: Set up Python uses: actions/setup-python@v6 with: From 3db9a05c73f056371bac5194dd406fd758e153aa Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 13:08:13 +0000 Subject: [PATCH 03/30] Replace `release-branches.py` with TS version in `release-branches` action --- .github/actions/release-branches/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/release-branches/action.yml b/.github/actions/release-branches/action.yml index 1807c0a3c0..26be726205 100644 --- a/.github/actions/release-branches/action.yml +++ b/.github/actions/release-branches/action.yml @@ -22,7 +22,8 @@ runs: MAJOR_VERSION: ${{ inputs.major_version }} LATEST_TAG: ${{ inputs.latest_tag }} run: | - python ${{ github.action_path }}/release-branches.py \ + npm ci + npx tsx ./pr-checks/release-branches.ts \ --major-version "$MAJOR_VERSION" \ --latest-tag "$LATEST_TAG" shell: bash From 0d87a7582993b7f55f7e4917950b434ff82bb9dc Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 13:09:11 +0000 Subject: [PATCH 04/30] Refactor backport computation into `computeReleaseBranches` --- pr-checks/release-branches.ts | 87 ++++++++++++++++++++++++----------- 1 file changed, 61 insertions(+), 26 deletions(-) diff --git a/pr-checks/release-branches.ts b/pr-checks/release-branches.ts index 03f5e5bc6d..3efca40972 100755 --- a/pr-checks/release-branches.ts +++ b/pr-checks/release-branches.ts @@ -6,6 +6,57 @@ import * as core from "@actions/core"; import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; +/** The results of checking which release branches to backport to. */ +export interface BackportInfo { + /** The source release branch. */ + backportSourceBranch: string; + /** + * The computed release branches we should backport to. + * Will be empty if there are no branches we need to backport to. + */ + backportTargetBranches: string[]; +} + +/** + * Compute the backport source and target branches for a release. + * + * @param majorVersion - The major version string (e.g. "v4"). + * @param latestTag - The most recent tag published to the repository (e.g. "v4.32.6"). + * @param oldestSupportedMajorVersion - The oldest supported major version number. + * @returns The names of the source branch and target branches. + */ +export function computeBackportBranches( + majorVersion: string, + latestTag: string, + oldestSupportedMajorVersion: number, +): BackportInfo { + const majorVersionNumber = Number.parseInt(majorVersion.substring(1)); + const latestTagMajor = Number.parseInt(latestTag.split(".")[0].substring(1)); + + // If this is a primary release, we backport to all supported branches, + // so we check whether the majorVersion taken from the package.json + // is greater than or equal to the latest tag pulled from the repo. + // For example... + // 'v1' >= 'v2' is False # we're operating from an older release branch and should not backport + // 'v2' >= 'v2' is True # the normal case where we're updating the current version + // 'v3' >= 'v2' is True # in this case we are making the first release of a new major version + const considerBackports = majorVersionNumber >= latestTagMajor; + + const backportSourceBranch = `releases/v${majorVersionNumber}`; + const backportTargetBranches: string[] = []; + + if (considerBackports) { + for (let i = majorVersionNumber - 1; i > 0; i--) { + const branch_name = `releases/v${i}`; + if (i >= oldestSupportedMajorVersion) { + backportTargetBranches.push(branch_name); + } + } + } + + return { backportSourceBranch, backportTargetBranches }; +} + async function main() { const { values: options } = parseArgs({ options: { @@ -28,38 +79,22 @@ async function main() { throw Error("--latest-tag is required"); } - const majorVersion = Number.parseInt(options["major-version"].substring(1)); + const majorVersion = options["major-version"]; const latestTag = options["latest-tag"]; - console.log(`major_version: v${majorVersion}`); - console.log(`latest_tag: ${latestTag}`); - - // If this is a primary release, we backport to all supported branches, - // so we check whether the major_version taken from the package.json - // is greater than or equal to the latest tag pulled from the repo. - // For example... - // 'v1' >= 'v2' is False # we're operating from an older release branch and should not backport - // 'v2' >= 'v2' is True # the normal case where we're updating the current version - // 'v3' >= 'v2' is True # in this case we are making the first release of a new major version - const latestTagMajor = Number.parseInt(latestTag.split(".")[0].substring(1)); - const considerBackports = majorVersion >= latestTagMajor; - - core.setOutput("backport_source_branch", `releases/v${majorVersion}`); - - const backportTargetBranches: string[] = []; + console.log(`Major version: ${majorVersion}`); + console.log(`Latest tag: ${latestTag}`); - if (considerBackports) { - for (let i = latestTagMajor - 1; i > 0; i--) { - const branch_name = `releases/v${i}`; - if (i >= OLDEST_SUPPORTED_MAJOR_VERSION) { - backportTargetBranches.push(branch_name); - } - } - } + const result = computeBackportBranches( + majorVersion, + latestTag, + OLDEST_SUPPORTED_MAJOR_VERSION, + ); + core.setOutput("backport_source_branch", result.backportSourceBranch); core.setOutput( "backport_target_branches", - JSON.stringify(backportTargetBranches), + JSON.stringify(result.backportTargetBranches), ); process.exit(0); From b72f4fec409d050db6cbc88df4d1438f710df9cd Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 13:21:22 +0000 Subject: [PATCH 05/30] Validate inputs --- pr-checks/release-branches.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/pr-checks/release-branches.ts b/pr-checks/release-branches.ts index 3efca40972..ceeaeefadb 100755 --- a/pr-checks/release-branches.ts +++ b/pr-checks/release-branches.ts @@ -30,8 +30,23 @@ export function computeBackportBranches( latestTag: string, oldestSupportedMajorVersion: number, ): BackportInfo { - const majorVersionNumber = Number.parseInt(majorVersion.substring(1)); - const latestTagMajor = Number.parseInt(latestTag.split(".")[0].substring(1)); + // Perform some sanity checks on the inputs. + // For `majorVersion`, we expect exactly `vN` for some `N`. + const majorVersionMatch = majorVersion.match(/^v(\d+)$/); + if (!majorVersionMatch) { + throw new Error("--major-version value must be in `vN` format."); + } + + // For latestTag, we expect something starting with `vN.M.P` + const latestTagMatch = latestTag.match(/^v(\d+)\.\d+\.\d+/); + if (!latestTagMatch) { + throw new Error( + `--latest-tag value must be in 'vN.M.P' format, but '${latestTag}' is not.`, + ); + } + + const majorVersionNumber = Number.parseInt(majorVersionMatch[1]); + const latestTagMajor = Number.parseInt(latestTagMatch[1]); // If this is a primary release, we backport to all supported branches, // so we check whether the majorVersion taken from the package.json @@ -60,11 +75,11 @@ export function computeBackportBranches( async function main() { const { values: options } = parseArgs({ options: { - // The major version of the release + // The major version of the release in `vN` format (e.g. `v4`). "major-version": { type: "string", }, - // The most recent tag published to the repository + // The most recent tag published to the repository (e.g. `v4.28.0`). "latest-tag": { type: "string", }, From 49af37b7ab733135b3b1ad15cff568c0a88c2bd2 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 13:25:15 +0000 Subject: [PATCH 06/30] Add tests for `release-branches.ts` --- pr-checks/release-branches.test.ts | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pr-checks/release-branches.test.ts diff --git a/pr-checks/release-branches.test.ts b/pr-checks/release-branches.test.ts new file mode 100644 index 0000000000..b33c7b85a7 --- /dev/null +++ b/pr-checks/release-branches.test.ts @@ -0,0 +1,61 @@ +#!/usr/bin/env npx tsx + +/* +Tests for the release-branches.ts script +*/ + +import * as assert from "node:assert/strict"; +import { describe, it } from "node:test"; + +import { computeBackportBranches } from "./release-branches"; + +describe("computeBackportBranches", async () => { + await it("rejects invalid major versions", () => { + // The majorVersion is expected to be in vN format. + assert.throws(() => computeBackportBranches("3", "v4.28.0", 3)); + assert.throws(() => computeBackportBranches("v3.1", "v4.28.0", 3)); + }); + + await it("rejects invalid latest tags", () => { + // The latestTag is expected to be in vN.M.P format. + assert.throws(() => computeBackportBranches("v3", "v4", 3)); + assert.throws(() => computeBackportBranches("v3", "4", 3)); + assert.throws(() => computeBackportBranches("v3", "v4.28", 3)); + assert.throws(() => computeBackportBranches("v3", "4.28", 3)); + assert.throws(() => computeBackportBranches("v3", "4.28.0", 3)); + }); + + await it("sets backport source branch based on major version", () => { + // Test that the backport source branch is releases/v{majorVersion} + const result = computeBackportBranches("v3", "v4.28.0", 3); + assert.equal(result.backportSourceBranch, "releases/v3"); + }); + + await it("no backport targets when major version is the oldest supported", () => { + // When majorVersion equals the major version of latestTag and we do not support older major versions, + // then there are no older supported branches to backport to. + const result = computeBackportBranches("v3", "v3.28.0", 3); + assert.deepEqual(result.backportTargetBranches, []); + }); + + await it("backports to older supported major versions", () => { + const result = computeBackportBranches("v4", "v4.1.0", 3); + assert.equal(result.backportSourceBranch, "releases/v4"); + assert.deepEqual(result.backportTargetBranches, ["releases/v3"]); + }); + + await it("backports to multiple older supported branches", () => { + const result = computeBackportBranches("v5", "v5.0.0", 3); + assert.equal(result.backportSourceBranch, "releases/v5"); + assert.deepEqual(result.backportTargetBranches, [ + "releases/v4", + "releases/v3", + ]); + }); + + await it("does not backport when major version is older than latest tag", () => { + const result = computeBackportBranches("v2", "v3.28.0", 2); + assert.equal(result.backportSourceBranch, "releases/v2"); + assert.deepEqual(result.backportTargetBranches, []); + }); +}); From 4867f5927a6b67ad3e88a7546979c2de097e5b97 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 18:46:21 +0000 Subject: [PATCH 07/30] Add config file for excluded checks from `update-required-checks.sh` --- pr-checks/excluded.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pr-checks/excluded.yml diff --git a/pr-checks/excluded.yml b/pr-checks/excluded.yml new file mode 100644 index 0000000000..104c1009eb --- /dev/null +++ b/pr-checks/excluded.yml @@ -0,0 +1,16 @@ +# PR checks to exclude from required checks +contains: + - "https://" + - "Update" + - "ESLint" + - "update" + - "test-setup-python-scripts" +is: + - "CodeQL" + - "Dependabot" + - "check-expected-release-files" + - "Agent" + - "Cleanup artifacts" + - "Prepare" + - "Upload results" + - "Label PR with size" From 9813849e61ccdd6d80626df9ab68ee0431c55a61 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 18:47:45 +0000 Subject: [PATCH 08/30] Add initial TS implementation of `update-required-checks.sh` --- pr-checks/sync-checks.ts | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 pr-checks/sync-checks.ts diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts new file mode 100755 index 0000000000..f447ace022 --- /dev/null +++ b/pr-checks/sync-checks.ts @@ -0,0 +1,46 @@ +#!/usr/bin/env npx tsx + +/** Update the required checks based on the current branch. */ + +import { parseArgs } from "node:util"; + +import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; + +async function main(): Promise { + const { values: options } = parseArgs({ + options: { + // The token to use to authenticate to the API. + token: { + type: "string", + }, + // The git ref for which to retrieve the check runs. + ref: { + type: "string", + }, + // By default, we perform a dry-run. Setting `apply` to `true` actually applies the changes. + apply: { + type: "boolean", + default: false, + }, + }, + strict: true, + }); + + if (options.token === undefined) { + throw new Error("Missing --token"); + } + if (options.ref === undefined) { + throw new Error("Missing --ref"); + } + + console.info( + `Oldest supported major version is: ${OLDEST_SUPPORTED_MAJOR_VERSION}`, + ); + + process.exit(0); +} + +// Only call `main` if this script was run directly. +if (require.main === module) { + void main(); +} From 9481177f3ded6eaac91e6bb74e30ed0fa45db604 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 18:49:50 +0000 Subject: [PATCH 09/30] Initialise API client --- package-lock.json | 64 +++++++++++++++++++++------------------- pr-checks/package.json | 4 +++ pr-checks/sync-checks.ts | 17 +++++++++++ 3 files changed, 55 insertions(+), 30 deletions(-) diff --git a/package-lock.json b/package-lock.json index c0ee6909b9..4c0800f0e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -411,36 +411,6 @@ "undici": "^6.23.0" } }, - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", - "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", - "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0" - }, - "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" - } - }, - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "17.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-17.0.0.tgz", - "integrity": "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==", - "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0" - }, - "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" - } - }, "node_modules/@actions/github/node_modules/undici": { "version": "6.23.0", "resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz", @@ -2138,6 +2108,21 @@ "integrity": "sha512-whrdktVs1h6gtR+09+QsNk2+FO+49j6ga1c55YZudfEG+oKJVvJLQi3zkOm5JjiUXAagWK2tI2kTGKJ2Ys7MGA==", "license": "MIT" }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz", + "integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, "node_modules/@octokit/plugin-request-log": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", @@ -2147,6 +2132,21 @@ "@octokit/core": ">=3" } }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-17.0.0.tgz", + "integrity": "sha512-B5yCyIlOJFPqUUeiD0cnBJwWJO8lkJs5d8+ze9QDP6SvfiXSz1BF+91+0MeI1d2yxgOhU/O+CvtiZ9jSkHhFAw==", + "license": "MIT", + "dependencies": { + "@octokit/types": "^16.0.0" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "@octokit/core": ">=6" + } + }, "node_modules/@octokit/plugin-retry": { "version": "8.0.3", "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-8.0.3.tgz", @@ -9921,6 +9921,10 @@ }, "devDependencies": { "@actions/core": "*", + "@actions/github": "*", + "@octokit/core": "*", + "@octokit/plugin-paginate-rest": "*", + "@octokit/plugin-rest-endpoint-methods": "*", "@types/node": "^20.19.9", "tsx": "^4.21.0", "typescript": "^5.9.3" diff --git a/pr-checks/package.json b/pr-checks/package.json index 7ec2fdc0fa..48bcf6ba38 100644 --- a/pr-checks/package.json +++ b/pr-checks/package.json @@ -6,6 +6,10 @@ }, "devDependencies": { "@actions/core": "*", + "@actions/github": "*", + "@octokit/core": "*", + "@octokit/plugin-paginate-rest": "*", + "@octokit/plugin-rest-endpoint-methods": "*", "@types/node": "^20.19.9", "tsx": "^4.21.0", "typescript": "^5.9.3" diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index f447ace022..f618cdcfa8 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -4,8 +4,22 @@ import { parseArgs } from "node:util"; +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 { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; +/** The type of the Octokit client. */ +type ApiClient = Octokit & Api & { paginate: PaginateInterface }; + +/** Constructs an `ApiClient` using `token` for authentication. */ +function getApiClient(token: string): ApiClient { + const opts = githubUtils.getOctokitOptions(token); + return new githubUtils.GitHub(opts); +} + async function main(): Promise { const { values: options } = parseArgs({ options: { @@ -37,6 +51,9 @@ async function main(): Promise { `Oldest supported major version is: ${OLDEST_SUPPORTED_MAJOR_VERSION}`, ); + // Initialise the API client. + const client = getApiClient(options.token); + process.exit(0); } From d2008eee7c4bd0ae1136e94903091da763f89096 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 18:53:03 +0000 Subject: [PATCH 10/30] Add type to represent `exclusions.yml` and loading helper --- pr-checks/sync-checks.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index f618cdcfa8..4cf4f4025b 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -2,15 +2,30 @@ /** Update the required checks based on the current branch. */ +import * as fs from "fs"; import { parseArgs } from "node:util"; 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 yaml from "yaml"; import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; +/** Represents a configuration of which checks should not be set up as required checks. */ +interface Exclusions { + /** A list of strings that, if contained in a check name, are excluded. */ + contains: string[]; + /** A list of check names that are excluded if their name is an exact match. */ + is: string[]; +} + +/** Loads the configuration for which checks to exclude. */ +function loadExclusions(): Exclusions { + return yaml.parse(fs.readFileSync("excluded.yml", "utf-8")) as Exclusions; +} + /** The type of the Octokit client. */ type ApiClient = Octokit & Api & { paginate: PaginateInterface }; From 1bc611ed0cf380ae8646c165d69bb1520806e76f Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:00:54 +0000 Subject: [PATCH 11/30] Fetch and filter check runs for `ref` --- pr-checks/sync-checks.ts | 91 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index 4cf4f4025b..55c5bd3b23 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -13,6 +13,12 @@ import * as yaml from "yaml"; import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; +/** Identifies the CodeQL Action repository. */ +const codeqlActionRepo = { + owner: "github", + repo: "codeql-action", +}; + /** Represents a configuration of which checks should not be set up as required checks. */ interface Exclusions { /** A list of strings that, if contained in a check name, are excluded. */ @@ -35,6 +41,86 @@ function getApiClient(token: string): ApiClient { return new githubUtils.GitHub(opts); } +/** + * Represents information about a check run. We track the `app_id` that generated the check, + * because the API will require it in addition to the name in the future. + */ +interface CheckInfo { + /** The display name of the check. */ + context: string; + /** The ID of the app that generated the check. */ + app_id: number; +} + +/** Removes entries from `checkInfos` based the configuration. */ +export function removeExcluded( + exclusions: Exclusions, + checkInfos: CheckInfo[], +): CheckInfo[] { + console.log(exclusions); + + return checkInfos.filter((checkInfo) => { + if (exclusions.is.includes(checkInfo.context)) { + console.info( + `Excluding '${checkInfo.context}' because it is an exact exclusion.`, + ); + return false; + } + + for (const containsStr of exclusions.contains) { + if (checkInfo.context.includes(containsStr)) { + console.info( + `Excluding '${checkInfo.context}' because it contains '${containsStr}'.`, + ); + return false; + } + } + + // Keep. + return true; + }); +} + +/** Gets a list of check run names for `ref`. */ +async function getChecksFor( + client: ApiClient, + ref: string, +): Promise { + console.info(`Getting checks for '${ref}'`); + + const response = await client.paginate( + "GET /repos/{owner}/{repo}/commits/{ref}/check-runs", + { + ...codeqlActionRepo, + ref, + }, + ); + + if (response.length === 0) { + throw new Error(`No checks found for '${ref}'.`); + } + + console.info(`Retrieved ${response.length} check runs.`); + + const notSkipped = response.filter( + (checkRun) => checkRun.conclusion !== "skipped", + ); + console.info(`Of those: ${notSkipped.length} were not skipped.`); + + // We use the ID of the app that generated the check run when returned by the API, + // but default to -1 to tell the API that any check with the given name should be + // required. + const checkInfos = notSkipped.map((check) => ({ + context: check.name, + app_id: check.app?.id || -1, + })); + + // Load the configuration for which checks to exclude and apply it before + // returning the checks. + const exclusions = loadExclusions(); + return removeExcluded(exclusions, checkInfos); +} + async function main(): Promise { const { values: options } = parseArgs({ options: { @@ -69,6 +155,11 @@ async function main(): Promise { // Initialise the API client. const client = getApiClient(options.token); + // Find the check runs for the specified `ref` that we will later set as the required checks + // for the main and release branches. + const checkInfos = await getChecksFor(client, options.ref); + const checkNames = new Set(checkInfos.map((info) => info.context)); + process.exit(0); } From a5244bf7dd2fc974f4d63cc0de5014740d9b85b7 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:05:27 +0000 Subject: [PATCH 12/30] Fetch release branches and identify major versions --- pr-checks/sync-checks.ts | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index 55c5bd3b23..38a6f599bb 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -121,6 +121,15 @@ async function getChecksFor( return removeExcluded(exclusions, checkInfos); } +/** Gets the current list of release branches. */ +async function getReleaseBranches(client: ApiClient): Promise { + const refs = await client.rest.git.listMatchingRefs({ + ...codeqlActionRepo, + ref: "heads/releases/v", + }); + return refs.data.map((ref) => ref.ref).sort(); +} + async function main(): Promise { const { values: options } = parseArgs({ options: { @@ -160,6 +169,38 @@ async function main(): Promise { const checkInfos = await getChecksFor(client, options.ref); const checkNames = new Set(checkInfos.map((info) => info.context)); + // Retrieve the refs of the release branches. + const releaseBranches = await getReleaseBranches(client); + console.info( + `Found ${releaseBranches.length} release branches: ${releaseBranches.join(", ")}`, + ); + + for (const releaseBranchRef of releaseBranches) { + // Sanity check that the ref name is in the expected format and extract the major version. + const releaseBranchMatch = releaseBranchRef.match( + /^refs\/heads\/(releases\/v(\d+))/, + ); + if (!releaseBranchMatch) { + console.warn( + `Branch ref '${releaseBranchRef}' not in the expected format.`, + ); + continue; + } + const releaseBranch = releaseBranchMatch[1]; + const releaseBranchMajor = Number.parseInt(releaseBranchMatch[2]); + + // Update the required checks for this major version if it is still supported. + if (releaseBranchMajor < OLDEST_SUPPORTED_MAJOR_VERSION) { + console.info( + `Skipping '${releaseBranch}' since it is older than v${OLDEST_SUPPORTED_MAJOR_VERSION}`, + ); + continue; + } else { + console.info(`Updating '${releaseBranch}'...`); + + } + } + process.exit(0); } From 74dd691a4550c112056a1b76df8b92a2c53644de Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:10:18 +0000 Subject: [PATCH 13/30] Identify changes before applying them --- pr-checks/sync-checks.ts | 42 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index 38a6f599bb..b1b2a8dd59 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -130,6 +130,46 @@ async function getReleaseBranches(client: ApiClient): Promise { return refs.data.map((ref) => ref.ref).sort(); } +/** Sets `checkNames` as required checks for `branch`. */ +async function updateBranch( + client: ApiClient, + branch: string, + checkNames: Set, +) { + // Query the current set of required checks for this branch. + const currentContexts = await client.rest.repos.getAllStatusCheckContexts({ + ...codeqlActionRepo, + branch, + }); + + // Identify which required checks we will remove and which ones we will add. + const currentCheckNames = new Set(currentContexts.data); + let additions = 0; + let removals = 0; + let unchanged = 0; + + for (const currentCheck of currentCheckNames) { + if (!checkNames.has(currentCheck)) { + console.info(`- Removing '${currentCheck}' for branch '${branch}'`); + removals++; + } else { + unchanged++; + } + } + for (const newCheck of checkNames) { + if (!currentCheckNames.has(newCheck)) { + console.info(`+ Adding '${newCheck}' for branch '${branch}'`); + additions++; + } + } + + console.info( + `For '${branch}': ${removals} removals; ${additions} additions; ${unchanged} unchanged`, + ); + + // TODO: actually perform the update +} + async function main(): Promise { const { values: options } = parseArgs({ options: { @@ -197,7 +237,7 @@ async function main(): Promise { continue; } else { console.info(`Updating '${releaseBranch}'...`); - + await updateBranch(client, releaseBranch, checkNames); } } From 4cec5d28309ed346d30906b9038ebdb3621ef62a Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:11:55 +0000 Subject: [PATCH 14/30] Call `updateBranch` for `main` --- pr-checks/sync-checks.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index b1b2a8dd59..e7226914aa 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -136,6 +136,8 @@ async function updateBranch( branch: string, checkNames: Set, ) { + console.info(`Updating '${branch}'...`); + // Query the current set of required checks for this branch. const currentContexts = await client.rest.repos.getAllStatusCheckContexts({ ...codeqlActionRepo, @@ -209,6 +211,9 @@ async function main(): Promise { const checkInfos = await getChecksFor(client, options.ref); const checkNames = new Set(checkInfos.map((info) => info.context)); + // Update the main branch. + await updateBranch(client, "main", checkNames); + // Retrieve the refs of the release branches. const releaseBranches = await getReleaseBranches(client); console.info( @@ -236,7 +241,6 @@ async function main(): Promise { ); continue; } else { - console.info(`Updating '${releaseBranch}'...`); await updateBranch(client, releaseBranch, checkNames); } } From 05431566942ae0f52b189bd376911b873e94b3ce Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:17:47 +0000 Subject: [PATCH 15/30] Actually perform the update when necessary and requested --- pr-checks/sync-checks.ts | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index e7226914aa..c969e2490b 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -13,6 +13,16 @@ import * as yaml from "yaml"; import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; +/** Represents the command-line options. */ +interface Options { + /** The token to use to authenticate to the GitHub API. */ + token?: string; + /** The git ref to use the checks for. */ + ref?: string; + /** Whether to actually apply the changes or not. */ + apply: boolean; +} + /** Identifies the CodeQL Action repository. */ const codeqlActionRepo = { owner: "github", @@ -130,8 +140,22 @@ async function getReleaseBranches(client: ApiClient): Promise { return refs.data.map((ref) => ref.ref).sort(); } +/** Updates the required status checks for `branch` to `checks`. */ +async function patchBranchProtectionRule( + client: ApiClient, + branch: string, + checks: Set, +) { + await client.rest.repos.setStatusCheckContexts({ + ...codeqlActionRepo, + branch, + contexts: Array.from(checks), + }); +} + /** Sets `checkNames` as required checks for `branch`. */ async function updateBranch( + options: Options, client: ApiClient, branch: string, checkNames: Set, @@ -169,7 +193,14 @@ async function updateBranch( `For '${branch}': ${removals} removals; ${additions} additions; ${unchanged} unchanged`, ); - // TODO: actually perform the update + // Perform the update if there are changes and `--apply` was specified. + if (unchanged === checkNames.size && removals === 0 && additions === 0) { + console.info("Not applying changes because there is nothing to do."); + } else if (options.apply) { + await patchBranchProtectionRule(client, branch, checkNames); + } else { + console.info("Not applying changes because `--apply` was not specified."); + } } async function main(): Promise { @@ -212,7 +243,7 @@ async function main(): Promise { const checkNames = new Set(checkInfos.map((info) => info.context)); // Update the main branch. - await updateBranch(client, "main", checkNames); + await updateBranch(options, client, "main", checkNames); // Retrieve the refs of the release branches. const releaseBranches = await getReleaseBranches(client); @@ -241,7 +272,7 @@ async function main(): Promise { ); continue; } else { - await updateBranch(client, releaseBranch, checkNames); + await updateBranch(options, client, releaseBranch, checkNames); } } From c5a984e1aabb625ea81f95cdc38a09d9398d460c Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:18:00 +0000 Subject: [PATCH 16/30] Update `CONTRIBUTING.md` --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26e06e30d3..f3935b7a2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,7 +122,7 @@ To deprecate an older version of the Action: - Implement an Actions warning for customers using the deprecated version. 1. Wait for the deprecation period to pass. 1. Upgrade the Actions warning for customers using the deprecated version to a non-fatal error, and mention that this version of the Action is no longer supported. -1. Make a PR to bump the `OLDEST_SUPPORTED_MAJOR_VERSION` in [releases.ini](.github/releases.ini). Once this PR is merged, the release process will no longer backport changes to the deprecated release version. +1. Make a PR to bump the `OLDEST_SUPPORTED_MAJOR_VERSION` in [config.ts](pr-checks/config.ts). Once this PR is merged, the release process will no longer backport changes to the deprecated release version. ## Resources From 9fe42f69b7de72555d6ce70549d2c2c762d3b197 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Mar 2026 19:35:44 +0000 Subject: [PATCH 17/30] Add some unit tests for `sync-checks.ts` --- pr-checks/sync-checks.test.ts | 49 +++++++++++++++++++++++++++++++++++ pr-checks/sync-checks.ts | 4 +-- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 pr-checks/sync-checks.test.ts diff --git a/pr-checks/sync-checks.test.ts b/pr-checks/sync-checks.test.ts new file mode 100644 index 0000000000..2f50b0e9e5 --- /dev/null +++ b/pr-checks/sync-checks.test.ts @@ -0,0 +1,49 @@ +#!/usr/bin/env npx tsx + +/* +Tests for the sync-checks.ts script +*/ + +import * as assert from "node:assert/strict"; +import { describe, it } from "node:test"; + +import { CheckInfo, Exclusions, removeExcluded } from "./sync-checks"; + +const toCheckInfo = (name: string) => + ({ context: name, app_id: -1 }) satisfies CheckInfo; + +const expectedPartialMatches = ["PR Check - Foo", "https://example.com"].map( + toCheckInfo, +); + +const expectedExactMatches = ["CodeQL", "Update"].map(toCheckInfo); + +const testChecks = expectedExactMatches.concat(expectedPartialMatches); + +const emptyExclusions: Exclusions = { + is: [], + contains: [], +}; + +describe("removeExcluded", async () => { + await it("retains all checks if no exclusions are configured", () => { + const retained = removeExcluded(emptyExclusions, testChecks); + assert.deepEqual(retained, testChecks); + }); + + await it("removes exact matches", () => { + const retained = removeExcluded( + { ...emptyExclusions, is: ["CodeQL", "Update"] }, + testChecks, + ); + assert.deepEqual(retained, expectedPartialMatches); + }); + + await it("removes partial matches", () => { + const retained = removeExcluded( + { ...emptyExclusions, contains: ["https://", "PR Check"] }, + testChecks, + ); + assert.deepEqual(retained, expectedExactMatches); + }); +}); diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index c969e2490b..a8c3665b9b 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -30,7 +30,7 @@ const codeqlActionRepo = { }; /** Represents a configuration of which checks should not be set up as required checks. */ -interface Exclusions { +export interface Exclusions { /** A list of strings that, if contained in a check name, are excluded. */ contains: string[]; /** A list of check names that are excluded if their name is an exact match. */ @@ -55,7 +55,7 @@ function getApiClient(token: string): ApiClient { * Represents information about a check run. We track the `app_id` that generated the check, * because the API will require it in addition to the name in the future. */ -interface CheckInfo { +export interface CheckInfo { /** The display name of the check. */ context: string; /** The ID of the app that generated the check. */ From cfc18781e07dd505bfa0315bab481c165fd5df5c Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 16 Mar 2026 09:25:52 +0000 Subject: [PATCH 18/30] Rebuild --- lib/analyze-action-post.js | 20 ++++++++++---------- lib/analyze-action.js | 20 ++++++++++---------- lib/autobuild-action.js | 20 ++++++++++---------- lib/init-action-post.js | 20 ++++++++++---------- lib/init-action.js | 20 ++++++++++---------- lib/resolve-environment-action.js | 20 ++++++++++---------- lib/setup-codeql-action.js | 20 ++++++++++---------- lib/start-proxy-action-post.js | 20 ++++++++++---------- lib/start-proxy-action.js | 20 ++++++++++---------- lib/upload-lib.js | 20 ++++++++++---------- lib/upload-sarif-action-post.js | 20 ++++++++++---------- lib/upload-sarif-action.js | 20 ++++++++++---------- 12 files changed, 120 insertions(+), 120 deletions(-) diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 75be56ced1..cbcb7cfaee 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 268cfad571..017b3cd10e 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 7720f03cb0..1f629463ad 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 341449f7e1..691734e51a 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/init-action.js b/lib/init-action.js index ec26268cb9..204c408136 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index cefba2d562..c3ca1c028e 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 8fcb624980..b95b31cfe6 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 0160eecbd9..d9c4ba3dd2 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index a1b8a027f8..3845eabfdb 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 3527c53649..2fa5500d56 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -42354,18 +42354,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -44659,7 +44659,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -44710,7 +44710,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -44788,7 +44788,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -44808,7 +44808,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -44816,7 +44816,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -44942,7 +44942,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index 74a5b57fd9..96f211c050 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index da345bf9a9..d45a09360a 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -41057,18 +41057,18 @@ var init_dist_src2 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js var VERSION5; var init_version2 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js"() { VERSION5 = "17.0.0"; } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js var Endpoints, endpoints_default; var init_endpoints = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js"() { Endpoints = { actions: { addCustomLabelsToSelfHostedRunnerForOrg: [ @@ -43362,7 +43362,7 @@ var init_endpoints = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js function endpointsToMethods(octokit) { const newMethods = {}; for (const scope of endpointMethodsMap.keys()) { @@ -43413,7 +43413,7 @@ function decorate(octokit, scope, methodName, defaults, decorations) { } var endpointMethodsMap, handler; var init_endpoints_to_methods = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/endpoints-to-methods.js"() { init_endpoints(); endpointMethodsMap = /* @__PURE__ */ new Map(); for (const [scope, endpoints] of Object.entries(endpoints_default)) { @@ -43491,7 +43491,7 @@ var init_endpoints_to_methods = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js +// node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js var dist_src_exports2 = {}; __export(dist_src_exports2, { legacyRestEndpointMethods: () => legacyRestEndpointMethods, @@ -43511,7 +43511,7 @@ function legacyRestEndpointMethods(octokit) { }; } var init_dist_src3 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { + "node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/index.js"() { init_version2(); init_endpoints_to_methods(); restEndpointMethods.VERSION = VERSION5; @@ -43519,7 +43519,7 @@ var init_dist_src3 = __esm({ } }); -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js +// node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js var dist_bundle_exports = {}; __export(dist_bundle_exports, { composePaginateRest: () => composePaginateRest, @@ -43645,7 +43645,7 @@ function paginateRest(octokit) { } var VERSION6, composePaginateRest, paginatingEndpoints; var init_dist_bundle5 = __esm({ - "node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { + "node_modules/@octokit/plugin-paginate-rest/dist-bundle/index.js"() { VERSION6 = "0.0.0-development"; composePaginateRest = Object.assign(paginate, { iterator From 75ed461aaa8332faf7f93e76c4b0b91dcc3b3146 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 16 Mar 2026 09:34:25 +0000 Subject: [PATCH 19/30] Add `excluded.yml` path to `config.ts` --- pr-checks/config.ts | 8 ++++++++ pr-checks/sync-checks.ts | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pr-checks/config.ts b/pr-checks/config.ts index 73001f13d5..7f2826d59c 100644 --- a/pr-checks/config.ts +++ b/pr-checks/config.ts @@ -1,2 +1,10 @@ +import path from "path"; + /** The oldest supported major version of the CodeQL Action. */ export const OLDEST_SUPPORTED_MAJOR_VERSION = 3; + +/** The `pr-checks` directory. */ +export const PR_CHECKS_DIR = __dirname; + +/** The path of the file configuring which checks shouldn't be required. */ +export const PR_CHECK_EXCLUDED_FILE = path.join(PR_CHECKS_DIR, "excluded.yml"); diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index a8c3665b9b..604f1df9de 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -11,7 +11,10 @@ import { type PaginateInterface } from "@octokit/plugin-paginate-rest"; import { type Api } from "@octokit/plugin-rest-endpoint-methods"; import * as yaml from "yaml"; -import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config"; +import { + OLDEST_SUPPORTED_MAJOR_VERSION, + PR_CHECK_EXCLUDED_FILE, +} from "./config"; /** Represents the command-line options. */ interface Options { @@ -39,7 +42,9 @@ export interface Exclusions { /** Loads the configuration for which checks to exclude. */ function loadExclusions(): Exclusions { - return yaml.parse(fs.readFileSync("excluded.yml", "utf-8")) as Exclusions; + return yaml.parse( + fs.readFileSync(PR_CHECK_EXCLUDED_FILE, "utf-8"), + ) as Exclusions; } /** The type of the Octokit client. */ From 9fd40ff50882f2981a92f4ced4494ce92d0df352 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 16 Mar 2026 09:41:10 +0000 Subject: [PATCH 20/30] Tidy up `pr-checks/package.json` --- package-lock.json | 13 ++++++------- pr-checks/package.json | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4c0800f0e6..9441340858 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9917,17 +9917,16 @@ }, "pr-checks": { "dependencies": { + "@actions/core": "^2.0.3", + "@actions/github": "^8.0.1", + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": ">=9.2.2", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "yaml": "^2.8.2" }, "devDependencies": { - "@actions/core": "*", - "@actions/github": "*", - "@octokit/core": "*", - "@octokit/plugin-paginate-rest": "*", - "@octokit/plugin-rest-endpoint-methods": "*", "@types/node": "^20.19.9", - "tsx": "^4.21.0", - "typescript": "^5.9.3" + "tsx": "^4.21.0" } } } diff --git a/pr-checks/package.json b/pr-checks/package.json index 48bcf6ba38..bbd4db8733 100644 --- a/pr-checks/package.json +++ b/pr-checks/package.json @@ -2,16 +2,15 @@ "private": true, "description": "Dependencies for the sync.ts", "dependencies": { + "@actions/core": "^2.0.3", + "@actions/github": "^8.0.1", + "@octokit/core": "^7.0.6", + "@octokit/plugin-paginate-rest": ">=9.2.2", + "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "yaml": "^2.8.2" }, "devDependencies": { - "@actions/core": "*", - "@actions/github": "*", - "@octokit/core": "*", - "@octokit/plugin-paginate-rest": "*", - "@octokit/plugin-rest-endpoint-methods": "*", "@types/node": "^20.19.9", - "tsx": "^4.21.0", - "typescript": "^5.9.3" + "tsx": "^4.21.0" } } From 07f235e5f24800beb190d6032a22c101d0e81afc Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 16 Mar 2026 09:49:08 +0000 Subject: [PATCH 21/30] Add `--verbose` option --- pr-checks/sync-checks.test.ts | 15 +++++++++++++-- pr-checks/sync-checks.ts | 19 +++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/pr-checks/sync-checks.test.ts b/pr-checks/sync-checks.test.ts index 2f50b0e9e5..4d49084cba 100644 --- a/pr-checks/sync-checks.test.ts +++ b/pr-checks/sync-checks.test.ts @@ -7,7 +7,12 @@ Tests for the sync-checks.ts script import * as assert from "node:assert/strict"; import { describe, it } from "node:test"; -import { CheckInfo, Exclusions, removeExcluded } from "./sync-checks"; +import { CheckInfo, Exclusions, Options, removeExcluded } from "./sync-checks"; + +const defaultOptions: Options = { + apply: false, + verbose: false, +}; const toCheckInfo = (name: string) => ({ context: name, app_id: -1 }) satisfies CheckInfo; @@ -27,12 +32,17 @@ const emptyExclusions: Exclusions = { describe("removeExcluded", async () => { await it("retains all checks if no exclusions are configured", () => { - const retained = removeExcluded(emptyExclusions, testChecks); + const retained = removeExcluded( + defaultOptions, + emptyExclusions, + testChecks, + ); assert.deepEqual(retained, testChecks); }); await it("removes exact matches", () => { const retained = removeExcluded( + defaultOptions, { ...emptyExclusions, is: ["CodeQL", "Update"] }, testChecks, ); @@ -41,6 +51,7 @@ describe("removeExcluded", async () => { await it("removes partial matches", () => { const retained = removeExcluded( + defaultOptions, { ...emptyExclusions, contains: ["https://", "PR Check"] }, testChecks, ); diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index 604f1df9de..787ef002de 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -17,13 +17,15 @@ import { } from "./config"; /** Represents the command-line options. */ -interface Options { +export interface Options { /** The token to use to authenticate to the GitHub API. */ token?: string; /** The git ref to use the checks for. */ ref?: string; /** Whether to actually apply the changes or not. */ apply: boolean; + /** Whether to output additional information. */ + verbose: boolean; } /** Identifies the CodeQL Action repository. */ @@ -69,10 +71,13 @@ export interface CheckInfo { /** Removes entries from `checkInfos` based the configuration. */ export function removeExcluded( + options: Options, exclusions: Exclusions, checkInfos: CheckInfo[], ): CheckInfo[] { - console.log(exclusions); + if (options.verbose) { + console.log(exclusions); + } return checkInfos.filter((checkInfo) => { if (exclusions.is.includes(checkInfo.context)) { @@ -98,6 +103,7 @@ export function removeExcluded( /** Gets a list of check run names for `ref`. */ async function getChecksFor( + options: Options, client: ApiClient, ref: string, ): Promise { @@ -133,7 +139,7 @@ async function getChecksFor( // Load the configuration for which checks to exclude and apply it before // returning the checks. const exclusions = loadExclusions(); - return removeExcluded(exclusions, checkInfos); + return removeExcluded(options, exclusions, checkInfos); } /** Gets the current list of release branches. */ @@ -224,6 +230,11 @@ async function main(): Promise { type: "boolean", default: false, }, + // Whether to output additional information. + verbose: { + type: "boolean", + default: false, + }, }, strict: true, }); @@ -244,7 +255,7 @@ async function main(): Promise { // Find the check runs for the specified `ref` that we will later set as the required checks // for the main and release branches. - const checkInfos = await getChecksFor(client, options.ref); + const checkInfos = await getChecksFor(options, client, options.ref); const checkNames = new Set(checkInfos.map((info) => info.context)); // Update the main branch. From 0abe92ed2055a61edd39fd41f7b69e8e49d79376 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 16 Mar 2026 09:55:45 +0000 Subject: [PATCH 22/30] Configure ESLint `import/no-extraneous-dependencies` rule for `pr-checks` --- eslint.config.mjs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index bc77329978..34fe49a9df 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,7 +7,11 @@ import noAsyncForeach from "eslint-plugin-no-async-foreach"; import jsdoc from "eslint-plugin-jsdoc"; import tseslint from "typescript-eslint"; import globals from "globals"; +import path from "path"; +import { fileURLToPath } from "url"; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); const githubFlatConfigs = github.getFlatConfigs(); export default [ @@ -43,7 +47,7 @@ export default [ plugins: { "import-x": importX, "no-async-foreach": fixupPluginRules(noAsyncForeach), - "jsdoc": jsdoc, + jsdoc: jsdoc, }, languageOptions: { @@ -67,7 +71,13 @@ export default [ typescript: {}, }, - "import/ignore": ["sinon", "uuid", "@octokit/plugin-retry", "del", "get-folder-size"], + "import/ignore": [ + "sinon", + "uuid", + "@octokit/plugin-retry", + "del", + "get-folder-size", + ], "import-x/resolver-next": [ createTypeScriptImportResolver(), createNodeResolver({ @@ -143,7 +153,7 @@ export default [ // We don't currently require full JSDoc coverage, so this rule // should not error on missing @param annotations. disableMissingParamChecks: true, - } + }, ], }, }, @@ -162,9 +172,9 @@ export default [ "@typescript-eslint/no-unused-vars": [ "error", { - "args": "all", - "argsIgnorePattern": "^_", - } + args: "all", + argsIgnorePattern: "^_", + }, ], "func-style": "off", }, @@ -183,6 +193,11 @@ export default [ // The scripts in `pr-checks` are expected to output to the console. "no-console": "off", + "import/no-extraneous-dependencies": [ + "error", + { packageDir: [__dirname, path.resolve(__dirname, "pr-checks")] }, + ], + "@typescript-eslint/no-floating-promises": [ "error", { From 0da31398135f2e324c0255c0a671b268833f27c5 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 13:35:02 +0000 Subject: [PATCH 23/30] Rename to `branchName` --- pr-checks/release-branches.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pr-checks/release-branches.ts b/pr-checks/release-branches.ts index ceeaeefadb..d0b4702018 100755 --- a/pr-checks/release-branches.ts +++ b/pr-checks/release-branches.ts @@ -62,9 +62,9 @@ export function computeBackportBranches( if (considerBackports) { for (let i = majorVersionNumber - 1; i > 0; i--) { - const branch_name = `releases/v${i}`; + const branchName = `releases/v${i}`; if (i >= oldestSupportedMajorVersion) { - backportTargetBranches.push(branch_name); + backportTargetBranches.push(branchName); } } } From fa568ebc6958579c3193119012bf8eb36b66de92 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 13:37:41 +0000 Subject: [PATCH 24/30] Delete `release-branches.py` --- .../release-branches/release-branches.py | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 .github/actions/release-branches/release-branches.py diff --git a/.github/actions/release-branches/release-branches.py b/.github/actions/release-branches/release-branches.py deleted file mode 100644 index ad941bb0c3..0000000000 --- a/.github/actions/release-branches/release-branches.py +++ /dev/null @@ -1,55 +0,0 @@ -import argparse -import json -import os -import configparser - -# Name of the remote -ORIGIN = 'origin' - -script_dir = os.path.dirname(os.path.realpath(__file__)) -grandparent_dir = os.path.dirname(os.path.dirname(script_dir)) - -config = configparser.ConfigParser() -with open(os.path.join(grandparent_dir, 'releases.ini')) as stream: - config.read_string('[default]\n' + stream.read()) - -OLDEST_SUPPORTED_MAJOR_VERSION = int(config['default']['OLDEST_SUPPORTED_MAJOR_VERSION']) - -def main(): - - parser = argparse.ArgumentParser() - parser.add_argument("--major-version", required=True, type=str, help="The major version of the release") - parser.add_argument("--latest-tag", required=True, type=str, help="The most recent tag published to the repository") - args = parser.parse_args() - - major_version = args.major_version - latest_tag = args.latest_tag - - print("major_version: " + major_version) - print("latest_tag: " + latest_tag) - - # If this is a primary release, we backport to all supported branches, - # so we check whether the major_version taken from the package.json - # is greater than or equal to the latest tag pulled from the repo. - # For example... - # 'v1' >= 'v2' is False # we're operating from an older release branch and should not backport - # 'v2' >= 'v2' is True # the normal case where we're updating the current version - # 'v3' >= 'v2' is True # in this case we are making the first release of a new major version - consider_backports = ( major_version >= latest_tag.split(".")[0] ) - - with open(os.environ["GITHUB_OUTPUT"], "a") as f: - - f.write(f"backport_source_branch=releases/{major_version}\n") - - backport_target_branches = [] - - if consider_backports: - for i in range(int(major_version.strip("v"))-1, 0, -1): - branch_name = f"releases/v{i}" - if i >= OLDEST_SUPPORTED_MAJOR_VERSION: - backport_target_branches.append(branch_name) - - f.write("backport_target_branches="+json.dumps(backport_target_branches)+"\n") - -if __name__ == "__main__": - main() From e7c7b68c5fc3986314391a41d15633f21f90df97 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 13:38:28 +0000 Subject: [PATCH 25/30] Remove `update-required-checks.sh` --- .../script/update-required-checks.sh | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100755 .github/workflows/script/update-required-checks.sh diff --git a/.github/workflows/script/update-required-checks.sh b/.github/workflows/script/update-required-checks.sh deleted file mode 100755 index f6a4c4f5c8..0000000000 --- a/.github/workflows/script/update-required-checks.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# Update the required checks based on the current branch. - -set -euo pipefail - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -REPO_DIR="$(dirname "$SCRIPT_DIR")" -GRANDPARENT_DIR="$(dirname "$REPO_DIR")" -source "$GRANDPARENT_DIR/releases.ini" - -if ! gh auth status 2>/dev/null; then - gh auth status - echo "Failed: Not authorized. This script requires admin access to github/codeql-action through the gh CLI." - exit 1 -fi - -if [ "$#" -eq 1 ]; then - # If we were passed an argument, use that as the SHA - GITHUB_SHA="$1" -elif [ "$#" -gt 1 ]; then - echo "Usage: $0 [SHA]" - echo "Update the required checks based on the SHA, or main." - exit 1 -elif [ -z "$GITHUB_SHA" ]; then - # If we don't have a SHA, use main - GITHUB_SHA="$(git rev-parse main)" -fi - -echo "Getting checks for $GITHUB_SHA" - -# Ignore any checks with "https://", CodeQL, LGTM, Update, and ESLint checks. -CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs.[] | select(.conclusion != "skipped") | .name | select(contains("https://") or . == "CodeQL" or . == "Dependabot" or . == "check-expected-release-files" or contains("Update") or contains("ESLint") or contains("update") or contains("test-setup-python-scripts") or . == "Agent" or . == "Cleanup artifacts" or . == "Prepare" or . == "Upload results" or . == "Label PR with size" | not)] | unique | sort')" - -echo "$CHECKS" | jq - -# Fail if there are no checks -if [ -z "$CHECKS" ] || [ "$(echo "$CHECKS" | jq '. | length')" -eq 0 ]; then - echo "No checks found for $GITHUB_SHA" - exit 1 -fi - -echo "{\"contexts\": ${CHECKS}}" > checks.json - -echo "Updating main" -gh api --silent -X "PATCH" "repos/github/codeql-action/branches/main/protection/required_status_checks" --input checks.json - -# list all branchs on origin remote matching releases/v* -BRANCHES="$(git ls-remote --heads origin 'releases/v*' | sed 's?.*refs/heads/??' | sort -V)" - -for BRANCH in $BRANCHES; do - - # strip exact 'releases/v' prefix from $BRANCH using count of characters - VERSION="${BRANCH:10}" - - if [ "$VERSION" -lt "$OLDEST_SUPPORTED_MAJOR_VERSION" ]; then - echo "Skipping $BRANCH" - continue - fi - - echo "Updating $BRANCH" - gh api --silent -X "PATCH" "repos/github/codeql-action/branches/$BRANCH/protection/required_status_checks" --input checks.json -done - -rm checks.json From 661a8fbbe3e3c9289e0631b0c711d5ca594f1afd Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 13:40:05 +0000 Subject: [PATCH 26/30] Default `ref` to `main` --- pr-checks/sync-checks.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index 787ef002de..58e9cc8ad6 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -224,6 +224,7 @@ async function main(): Promise { // The git ref for which to retrieve the check runs. ref: { type: "string", + default: "main", }, // By default, we perform a dry-run. Setting `apply` to `true` actually applies the changes. apply: { @@ -242,9 +243,6 @@ async function main(): Promise { if (options.token === undefined) { throw new Error("Missing --token"); } - if (options.ref === undefined) { - throw new Error("Missing --ref"); - } console.info( `Oldest supported major version is: ${OLDEST_SUPPORTED_MAJOR_VERSION}`, From fae4c28b513b0752758b780e0b2421d3f8b55901 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 13:48:55 +0000 Subject: [PATCH 27/30] Update `CONTRIBUTING.md` --- CONTRIBUTING.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3935b7a2b..12a675add6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -69,12 +69,14 @@ Once the mergeback and backport pull request have been merged, the release is co ## Keeping the PR checks up to date (admin access required) -Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred required jobs that need to pass in order for a PR to turn green. It would be too tedious to maintain that list manually. You can regenerate the set of required checks automatically by running the [update-required-checks.sh](.github/workflows/script/update-required-checks.sh) script: +Since the `codeql-action` runs most of its testing through individual Actions workflows, there are over two hundred required jobs that need to pass in order for a PR to turn green. It would be too tedious to maintain that list manually. You can regenerate the set of required checks automatically by running the [sync-checks.ts](pr-checks/sync-checks.ts) script: -- If you run the script without an argument, it will retrieve the set of workflows that ran for the latest commit on `main`. Make sure that your local `main` branch is up to date before running the script. -- You can specify a commit SHA as argument to retrieve the set of workflows for that commit instead. You will likely want to use this if you have a PR that removes or adds PR checks. +- At a minimum, you must provide an argument for the `--token` input. For example, `--token "$(gh auth token)"` to use the same token that `gh` uses. If no token is provided or the token has insufficient permissions, the script will fail. +- By default, the script performs a dry run and outputs information about the changes it would make to the branch protection rules. To actually apply the changes, specify the `--apply` flag. +- If you run the script without any other arguments, it will retrieve the set of workflows that ran for the latest commit on `main`. +- You can specify a different git ref with the `--ref` input. You will likely want to use this if you have a PR that removes or adds PR checks. For example, `--ref "some/branch/name` to use the HEAD of the `some/branch/name` branch. -After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v3`, and any other currently supported major versions have been updated. +After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v4`, and any other currently supported major versions have been updated. Note that any updates to checks on `main` need to be backported to all currently supported major version branches, in order to maintain the same set of names for required checks. From a5418e172c7fae2bb89b7098006e024e33506de7 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 13:49:47 +0000 Subject: [PATCH 28/30] Delete `releases.ini` --- .github/releases.ini | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .github/releases.ini diff --git a/.github/releases.ini b/.github/releases.ini deleted file mode 100644 index 69afa026d4..0000000000 --- a/.github/releases.ini +++ /dev/null @@ -1 +0,0 @@ -OLDEST_SUPPORTED_MAJOR_VERSION=3 From 8a0b4f2746fbf0103387da52d4bf553c17e996d9 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 14:14:49 +0000 Subject: [PATCH 29/30] fixup! Update `CONTRIBUTING.md` --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12a675add6..2360f19f9d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,7 +74,7 @@ Since the `codeql-action` runs most of its testing through individual Actions wo - At a minimum, you must provide an argument for the `--token` input. For example, `--token "$(gh auth token)"` to use the same token that `gh` uses. If no token is provided or the token has insufficient permissions, the script will fail. - By default, the script performs a dry run and outputs information about the changes it would make to the branch protection rules. To actually apply the changes, specify the `--apply` flag. - If you run the script without any other arguments, it will retrieve the set of workflows that ran for the latest commit on `main`. -- You can specify a different git ref with the `--ref` input. You will likely want to use this if you have a PR that removes or adds PR checks. For example, `--ref "some/branch/name` to use the HEAD of the `some/branch/name` branch. +- You can specify a different git ref with the `--ref` input. You will likely want to use this if you have a PR that removes or adds PR checks. For example, `--ref "some/branch/name"` to use the HEAD of the `some/branch/name` branch. After running, go to the [branch protection rules settings page](https://github.com/github/codeql-action/settings/branches) and validate that the rules for `main`, `v4`, and any other currently supported major versions have been updated. From 972365e1423586e7712714268c814e2f8053fba8 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 25 Mar 2026 14:15:39 +0000 Subject: [PATCH 30/30] Fix comment --- pr-checks/sync-checks.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr-checks/sync-checks.ts b/pr-checks/sync-checks.ts index 58e9cc8ad6..5b5b0bd26e 100755 --- a/pr-checks/sync-checks.ts +++ b/pr-checks/sync-checks.ts @@ -69,7 +69,7 @@ export interface CheckInfo { app_id: number; } -/** Removes entries from `checkInfos` based the configuration. */ +/** Removes entries from `checkInfos` based on the configuration. */ export function removeExcluded( options: Options, exclusions: Exclusions,