Skip to content

Commit 67cd8c1

Browse files
committed
Rename env var to DIAGNOSTICS_DIR
1 parent 4707994 commit 67cd8c1

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎.github/workflows/__diagnostics-without-db.yml‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pr-checks/checks/diagnostics-without-db.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ steps:
3838

3939
- name: Check diagnostics appear on disk
4040
env:
41-
SARIF_PATH: "${{ runner.temp }}/codeql-action-temp-diagnostics/"
41+
DIAGNOSTICS_DIR: "${{ runner.temp }}/codeql-action-temp-diagnostics/"
4242
run: |
4343
cd ../action
4444
npx tsx ./pr-checks/diagnostics-without-db.ts

‎pr-checks/diagnostics-without-db.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import * as core from "@actions/core";
66
import type * as diagnostics from "../src/diagnostics";
77

88
const DIAGNOSTIC_ID = "codeql-action/forced-nightly-cli";
9-
const sarifDirectory = process.env["SARIF_PATH"];
9+
const diagnosticDirectory = process.env["DIAGNOSTICS_DIR"];
1010

11-
if (sarifDirectory === undefined) {
12-
throw new Error("SARIF_PATH is undefined.");
11+
if (diagnosticDirectory === undefined) {
12+
throw new Error("DIAGNOSTICS_DIR is undefined.");
1313
}
1414

1515
const paths = fs
16-
.readdirSync(sarifDirectory, {
16+
.readdirSync(diagnosticDirectory, {
1717
recursive: true,
1818
encoding: "utf-8",
1919
})
2020
.filter((p) => p.endsWith(".json"));
2121

22-
core.info(`Found ${paths.length} paths in '${sarifDirectory}'.`);
22+
core.info(`Found ${paths.length} paths in '${diagnosticDirectory}'.`);
2323
core.info(`Searching for a diagnostic with id '${DIAGNOSTIC_ID}'...`);
2424

2525
let found = false;
@@ -31,7 +31,7 @@ for (const diagnosticPath of paths) {
3131
core.info(`Found ${diagnosticPath}.`);
3232

3333
const contents = JSON.parse(
34-
fs.readFileSync(path.resolve(sarifDirectory, diagnosticPath), "utf-8"),
34+
fs.readFileSync(path.resolve(diagnosticDirectory, diagnosticPath), "utf-8"),
3535
) as diagnostics.DiagnosticMessage;
3636

3737
if (contents.source.id === DIAGNOSTIC_ID) {

0 commit comments

Comments
 (0)