From 75ed461aaa8332faf7f93e76c4b0b91dcc3b3146 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 16 Mar 2026 09:34:25 +0000 Subject: [PATCH] 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 73001f13d..7f2826d59 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 a8c3665b9..604f1df9d 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. */