Add excluded.yml path to config.ts

This commit is contained in:
Michael B. Gale
2026-03-16 09:34:25 +00:00
parent cfc18781e0
commit 75ed461aaa
2 changed files with 15 additions and 2 deletions

View File

@@ -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");

View File

@@ -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. */