diff --git a/.github/workflows/sync-upstream-mike-escalated.yml b/.github/workflows/sync-upstream-mike-escalated.yml index 88d95b4e38..3ad8401503 100644 --- a/.github/workflows/sync-upstream-mike-escalated.yml +++ b/.github/workflows/sync-upstream-mike-escalated.yml @@ -56,7 +56,9 @@ jobs: script: | const fs = require("fs"); const { execFileSync } = require("child_process"); - const { findExistingUnmergedMikeProposal } = await import("./scripts/lib/mike-sync.mjs"); + const { pathToFileURL } = require("node:url"); + const mikeSyncUrl = pathToFileURL(`${process.env.GITHUB_WORKSPACE}/scripts/lib/mike-sync.mjs`); + const { findExistingUnmergedMikeProposal } = await import(mikeSyncUrl.href); const low = JSON.parse( fs.readFileSync("docs/upstream-mike-sync-state.json", "utf8"), ); diff --git a/.github/workflows/sync-upstream-mike.yml b/.github/workflows/sync-upstream-mike.yml index 561e398ea7..cb1dcb41a2 100644 --- a/.github/workflows/sync-upstream-mike.yml +++ b/.github/workflows/sync-upstream-mike.yml @@ -44,7 +44,9 @@ jobs: script: | const fs = require("fs"); const { execFileSync } = require("child_process"); - const { findExistingUnmergedMikeProposal } = await import("./scripts/lib/mike-sync.mjs"); + const { pathToFileURL } = require("node:url"); + const mikeSyncUrl = pathToFileURL(`${process.env.GITHUB_WORKSPACE}/scripts/lib/mike-sync.mjs`); + const { findExistingUnmergedMikeProposal } = await import(mikeSyncUrl.href); const state = JSON.parse( fs.readFileSync("docs/upstream-mike-sync-state.json", "utf8"), ); diff --git a/tests/baseline/ross-mike-sync-v2.test.mjs b/tests/baseline/ross-mike-sync-v2.test.mjs index 4f2ae52781..d40b6b9a22 100644 --- a/tests/baseline/ross-mike-sync-v2.test.mjs +++ b/tests/baseline/ross-mike-sync-v2.test.mjs @@ -209,6 +209,11 @@ test("workflow boundaries expose the deliberate deferred pass and bounded repair assert.match(workflow, /High-risk or security-sensitive work/); assert.match(workflow, /draft state-only architecture record/); assert.match(lowRiskWorkflow, /findExistingUnmergedMikeProposal/); + for (const syncWorkflow of [lowRiskWorkflow, workflow]) { + assert.match(syncWorkflow, /pathToFileURL/); + assert.match(syncWorkflow, /process\.env\.GITHUB_WORKSPACE/); + assert.doesNotMatch(syncWorkflow, /await import\("\.\/scripts\/lib\/mike-sync\.mjs"\)/); + } assert.match(lowRiskWorkflow, /settle-baseline-run\.sh/); assert.match(workflow, /settle-baseline-run\.sh/); assert.match(baselineHandler, /baseline_run_id:/);