Skip to content

Commit f3032c7

Browse files
committed
Add excluded.yml path to config.ts
1 parent c24690a commit f3032c7

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

pr-checks/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
import path from "path";
2+
13
/** The oldest supported major version of the CodeQL Action. */
24
export const OLDEST_SUPPORTED_MAJOR_VERSION = 3;
5+
6+
/** The `pr-checks` directory. */
7+
export const PR_CHECKS_DIR = __dirname;
8+
9+
/** The path of the file configuring which checks shouldn't be required. */
10+
export const PR_CHECK_EXCLUDED_FILE = path.join(PR_CHECKS_DIR, "excluded.yml");

pr-checks/sync-checks.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import { type PaginateInterface } from "@octokit/plugin-paginate-rest";
1111
import { type Api } from "@octokit/plugin-rest-endpoint-methods";
1212
import * as yaml from "yaml";
1313

14-
import { OLDEST_SUPPORTED_MAJOR_VERSION } from "./config";
14+
import {
15+
OLDEST_SUPPORTED_MAJOR_VERSION,
16+
PR_CHECK_EXCLUDED_FILE,
17+
} from "./config";
1518

1619
/** Represents the command-line options. */
1720
interface Options {
@@ -39,7 +42,9 @@ export interface Exclusions {
3942

4043
/** Loads the configuration for which checks to exclude. */
4144
function loadExclusions(): Exclusions {
42-
return yaml.parse(fs.readFileSync("excluded.yml", "utf-8")) as Exclusions;
45+
return yaml.parse(
46+
fs.readFileSync(PR_CHECK_EXCLUDED_FILE, "utf-8"),
47+
) as Exclusions;
4348
}
4449

4550
/** The type of the Octokit client. */

0 commit comments

Comments
 (0)