mirror of
https://github.com/github/codeql-action.git
synced 2026-03-31 00:32:17 +00:00
Add excluded.yml path to config.ts
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user