Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions preview/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 6 additions & 4 deletions preview/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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}`);
Expand All @@ -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));
Expand All @@ -24033,7 +24033,7 @@ var require_dist = __commonJS({
emit({
action,
phase: "error",
fernRunId: getOrCreateRunId(),
fernRunId: getOrCreateRunId2(),
githubRunId: getGithubRunId(),
error: message,
attributes
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 4 additions & 0 deletions preview/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as core from "@actions/core";
import * as github from "@actions/github";
import {
getOptionalInput,
getOrCreateRunId,
getRequiredFernToken,
installFernCli,
instrumentAction,
Expand Down Expand Up @@ -29,6 +30,9 @@ function parseInputs(): ActionInputs {
}

async function run(inputs: ActionInputs): Promise<void> {
const runId = getOrCreateRunId();
core.setOutput("run-id", runId);

await installFernCli(inputs.fernVersion);

const results = await runAutomationsPreview({ fernToken: inputs.fernToken });
Expand Down
Loading