diff --git a/.github/workflows/__diagnostics-without-db.yml b/.github/workflows/__diagnostics-without-db.yml index 27200f181..71c597d74 100644 --- a/.github/workflows/__diagnostics-without-db.yml +++ b/.github/workflows/__diagnostics-without-db.yml @@ -86,7 +86,7 @@ jobs: - name: Check diagnostics appear on disk env: - SARIF_PATH: '${{ runner.temp }}/codeql-action-temp-diagnostics/' + DIAGNOSTICS_DIR: '${{ runner.temp }}/codeql-action-temp-diagnostics/' run: | cd ../action npx tsx ./pr-checks/diagnostics-without-db.ts diff --git a/pr-checks/checks/diagnostics-without-db.yml b/pr-checks/checks/diagnostics-without-db.yml index f4bdfc451..e346a1cab 100644 --- a/pr-checks/checks/diagnostics-without-db.yml +++ b/pr-checks/checks/diagnostics-without-db.yml @@ -38,7 +38,7 @@ steps: - name: Check diagnostics appear on disk env: - SARIF_PATH: "${{ runner.temp }}/codeql-action-temp-diagnostics/" + DIAGNOSTICS_DIR: "${{ runner.temp }}/codeql-action-temp-diagnostics/" run: | cd ../action npx tsx ./pr-checks/diagnostics-without-db.ts diff --git a/pr-checks/diagnostics-without-db.ts b/pr-checks/diagnostics-without-db.ts index b742c10d6..b276260f9 100644 --- a/pr-checks/diagnostics-without-db.ts +++ b/pr-checks/diagnostics-without-db.ts @@ -6,20 +6,20 @@ import * as core from "@actions/core"; import type * as diagnostics from "../src/diagnostics"; const DIAGNOSTIC_ID = "codeql-action/forced-nightly-cli"; -const sarifDirectory = process.env["SARIF_PATH"]; +const diagnosticDirectory = process.env["DIAGNOSTICS_DIR"]; -if (sarifDirectory === undefined) { - throw new Error("SARIF_PATH is undefined."); +if (diagnosticDirectory === undefined) { + throw new Error("DIAGNOSTICS_DIR is undefined."); } const paths = fs - .readdirSync(sarifDirectory, { + .readdirSync(diagnosticDirectory, { recursive: true, encoding: "utf-8", }) .filter((p) => p.endsWith(".json")); -core.info(`Found ${paths.length} paths in '${sarifDirectory}'.`); +core.info(`Found ${paths.length} paths in '${diagnosticDirectory}'.`); core.info(`Searching for a diagnostic with id '${DIAGNOSTIC_ID}'...`); let found = false; @@ -31,7 +31,7 @@ for (const diagnosticPath of paths) { core.info(`Found ${diagnosticPath}.`); const contents = JSON.parse( - fs.readFileSync(path.resolve(sarifDirectory, diagnosticPath), "utf-8"), + fs.readFileSync(path.resolve(diagnosticDirectory, diagnosticPath), "utf-8"), ) as diagnostics.DiagnosticMessage; if (contents.source.id === DIAGNOSTIC_ID) {