diff --git a/preview/action.yml b/preview/action.yml index 1220f27..0ee10ad 100644 --- a/preview/action.yml +++ b/preview/action.yml @@ -18,6 +18,8 @@ inputs: outputs: results: description: "JSON array of preview results (status, groupName, packageName, installCommand, version)" + run-id: + description: "FERN_RUN_ID for this preview run (UUIDv4)" runs: using: "node20" diff --git a/preview/dist/index.js b/preview/dist/index.js index be21332..506cbff 100644 --- a/preview/dist/index.js +++ b/preview/dist/index.js @@ -23970,7 +23970,7 @@ var require_dist = __commonJS({ __export2(index_exports, { getGithubRunId: () => getGithubRunId, getOptionalInput: () => getOptionalInput2, - getOrCreateRunId: () => getOrCreateRunId, + getOrCreateRunId: () => getOrCreateRunId2, getRequiredFernToken: () => getRequiredFernToken2, getRequiredInput: () => getRequiredInput, installFernCli: () => installFernCli2, @@ -23986,7 +23986,7 @@ var require_dist = __commonJS({ }); module2.exports = __toCommonJS2(index_exports); var core4 = __toESM2(require_core()); - function getOrCreateRunId() { + function getOrCreateRunId2() { const existing = process.env.FERN_RUN_ID; if (existing) { core4.debug(`Inheriting FERN_RUN_ID from environment: ${existing}`); @@ -24011,7 +24011,7 @@ var require_dist = __commonJS({ } function recordStart(action, attributes) { const startedAt = Date.now(); - const fernRunId = getOrCreateRunId(); + const fernRunId = getOrCreateRunId2(); const githubRunId = getGithubRunId(); emit({ action, phase: "start", fernRunId, githubRunId, attributes }); core22.saveState(STATE_START_TIME, String(startedAt)); @@ -24033,7 +24033,7 @@ var require_dist = __commonJS({ emit({ action, phase: "error", - fernRunId: getOrCreateRunId(), + fernRunId: getOrCreateRunId2(), githubRunId: getGithubRunId(), error: message, attributes @@ -24426,6 +24426,8 @@ function parseInputs() { }; } async function run(inputs) { + const runId = (0, import_shared.getOrCreateRunId)(); + core3.setOutput("run-id", runId); await (0, import_shared.installFernCli)(inputs.fernVersion); const results = await runAutomationsPreview({ fernToken: inputs.fernToken }); if (results.length === 0) { diff --git a/preview/src/index.ts b/preview/src/index.ts index 89375cb..b391e49 100644 --- a/preview/src/index.ts +++ b/preview/src/index.ts @@ -2,6 +2,7 @@ import * as core from "@actions/core"; import * as github from "@actions/github"; import { getOptionalInput, + getOrCreateRunId, getRequiredFernToken, installFernCli, instrumentAction, @@ -29,6 +30,9 @@ function parseInputs(): ActionInputs { } async function run(inputs: ActionInputs): Promise { + const runId = getOrCreateRunId(); + core.setOutput("run-id", runId); + await installFernCli(inputs.fernVersion); const results = await runAutomationsPreview({ fernToken: inputs.fernToken });