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 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: 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 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", { diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index 3cad3205d7..7055b53a8f 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 d36f12b439..b7cbe5f022 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 17e6b918ca..851e6a14c1 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 247af7680c..e798c8d815 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 312b11f6ee..20390da196 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 24c2153a01..07b44edb78 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 d826367eee..19e1280a9e 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 0d3cec0719..f7e8fd680a 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 630151ee32..b82c61b585 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 f49b4c42ba..07ffa00c58 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 361becddc5..958e011535 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 3908d4f8c2..e6b32cd537 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 diff --git a/package-lock.json b/package-lock.json index 0dc89792b5..e79fd4ac75 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", @@ -9898,12 +9898,11 @@ }, "pr-checks": { "dependencies": { + "@octokit/core": "^7.0.6", "yaml": "^2.8.2" }, "devDependencies": { - "@types/node": "^20.19.9", - "tsx": "^4.21.0", - "typescript": "^5.9.3" + "tsx": "^4.21.0" } } } diff --git a/pr-checks/config.ts b/pr-checks/config.ts new file mode 100644 index 0000000000..7f2826d59c --- /dev/null +++ b/pr-checks/config.ts @@ -0,0 +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/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" diff --git a/pr-checks/package.json b/pr-checks/package.json index b323b98b83..a315942211 100644 --- a/pr-checks/package.json +++ b/pr-checks/package.json @@ -2,11 +2,10 @@ "private": true, "description": "Dependencies for the sync.ts", "dependencies": { + "@octokit/core": "^7.0.6", "yaml": "^2.8.2" }, "devDependencies": { - "@types/node": "^20.19.9", - "tsx": "^4.21.0", - "typescript": "^5.9.3" + "tsx": "^4.21.0" } } 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, []); + }); +}); diff --git a/pr-checks/release-branches.ts b/pr-checks/release-branches.ts new file mode 100755 index 0000000000..ceeaeefadb --- /dev/null +++ b/pr-checks/release-branches.ts @@ -0,0 +1,121 @@ +#!/usr/bin/env npx tsx + +import { parseArgs } from "node:util"; + +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 { + // 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 + // 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: { + // The major version of the release in `vN` format (e.g. `v4`). + "major-version": { + type: "string", + }, + // The most recent tag published to the repository (e.g. `v4.28.0`). + "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 = options["major-version"]; + const latestTag = options["latest-tag"]; + + console.log(`Major version: ${majorVersion}`); + console.log(`Latest tag: ${latestTag}`); + + const result = computeBackportBranches( + majorVersion, + latestTag, + OLDEST_SUPPORTED_MAJOR_VERSION, + ); + + core.setOutput("backport_source_branch", result.backportSourceBranch); + core.setOutput( + "backport_target_branches", + JSON.stringify(result.backportTargetBranches), + ); + + process.exit(0); +} + +// Only call `main` if this script was run directly. +if (require.main === module) { + void main(); +} 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 new file mode 100755 index 0000000000..270990d7ad --- /dev/null +++ b/pr-checks/sync-checks.ts @@ -0,0 +1,301 @@ +#!/usr/bin/env npx tsx + +/** 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, + PR_CHECK_EXCLUDED_FILE, +} 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; + /** Whether to output additional information. */ + verbose: boolean; +} + +/** 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. */ +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. */ + is: string[]; +} + +/** Loads the configuration for which checks to exclude. */ +function loadExclusions(): Exclusions { + return yaml.parse( + fs.readFileSync(PR_CHECK_EXCLUDED_FILE, "utf-8"), + ) as Exclusions; +} + +/** 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); +} + +/** + * 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. + */ +export 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( + options: Options, + exclusions: Exclusions, + checkInfos: CheckInfo[], +): CheckInfo[] { + if (options.verbose) { + 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( + options: Options, + 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(options, 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(); +} + +/** 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, +) { + console.info(`Updating '${branch}'...`); + + // 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`, + ); + + // 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 { + 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, + }, + // Whether to output additional information. + verbose: { + 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}`, + ); + + // 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(options, client, options.ref); + const checkNames = new Set(checkInfos.map((info) => info.context)); + + // Update the main branch. + await updateBranch(options, client, "main", checkNames); + + // 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 { + await updateBranch(options, client, releaseBranch, checkNames); + } + } + + process.exit(0); +} + +// Only call `main` if this script was run directly. +if (require.main === module) { + void main(); +}