diff --git a/core/src/plugins/exec/config.ts b/core/src/plugins/exec/config.ts index cbda98eb11..7b1b2a7451 100644 --- a/core/src/plugins/exec/config.ts +++ b/core/src/plugins/exec/config.ts @@ -31,6 +31,18 @@ export const execRuntimeOutputsSchema = s.object({ .describe( "The full log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants)" ), + stdout: s + .string() + .default("") + .describe( + "The stdout log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants)" + ), + stderr: s + .string() + .default("") + .describe( + "The stderr log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants)" + ), }) export const execCommonSchema = s.object({ diff --git a/core/src/plugins/exec/run.ts b/core/src/plugins/exec/run.ts index d9272b0570..2d58e0fb61 100644 --- a/core/src/plugins/exec/run.ts +++ b/core/src/plugins/exec/run.ts @@ -82,6 +82,8 @@ execRun.addHandler("run", async ({ artifactsPath, log, action, ctx }) => { detail, outputs: { log: commandResult.outputLog, + stdout: commandResult.stdout, + stderr: commandResult.stderr, }, } as const diff --git a/core/src/plugins/exec/test.ts b/core/src/plugins/exec/test.ts index 2f2981da8d..0c571fe2a9 100644 --- a/core/src/plugins/exec/test.ts +++ b/core/src/plugins/exec/test.ts @@ -84,6 +84,8 @@ execTest.addHandler("run", async ({ log, action, artifactsPath, ctx }) => { detail, outputs: { log: commandResult.outputLog, + stdout: commandResult.stdout, + stderr: commandResult.stderr, }, } as const @@ -102,5 +104,6 @@ execTest.addHandler("run", async ({ log, action, artifactsPath, ctx }) => { }) ) } + return result }) diff --git a/core/test/unit/src/plugins/exec/exec.ts b/core/test/unit/src/plugins/exec/exec.ts index 7be52e70a1..c2ef5ddbe2 100644 --- a/core/test/unit/src/plugins/exec/exec.ts +++ b/core/test/unit/src/plugins/exec/exec.ts @@ -443,6 +443,7 @@ describe("exec plugin", () => { }) expect(res.outputs.log).to.eql(basePath) + expect(res.outputs.stdout).to.eql(basePath) }) it("should receive version as an env var", async () => { @@ -480,6 +481,7 @@ describe("exec plugin", () => { silent: false, }) expect(res.outputs.log).to.equal(action.versionString()) + expect(res.outputs.stdout).to.equal(action.versionString()) }) }) diff --git a/docs/reference/action-types/Build/exec.md b/docs/reference/action-types/Build/exec.md index cb9477d236..65f1984df4 100644 --- a/docs/reference/action-types/Build/exec.md +++ b/docs/reference/action-types/Build/exec.md @@ -460,3 +460,19 @@ The full log output from the executed command. (Pro-tip: Make it machine readabl | -------- | ------- | | `string` | `""` | +### `${actions.build..outputs.stdout}` + +The stdout log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + +### `${actions.build..outputs.stderr}` + +The stderr log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + diff --git a/docs/reference/action-types/Deploy/exec.md b/docs/reference/action-types/Deploy/exec.md index 17fc291d86..17905df3ac 100644 --- a/docs/reference/action-types/Deploy/exec.md +++ b/docs/reference/action-types/Deploy/exec.md @@ -459,3 +459,19 @@ The full log output from the executed command. (Pro-tip: Make it machine readabl | -------- | ------- | | `string` | `""` | +### `${actions.deploy..outputs.stdout}` + +The stdout log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + +### `${actions.deploy..outputs.stderr}` + +The stderr log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + diff --git a/docs/reference/action-types/Run/exec.md b/docs/reference/action-types/Run/exec.md index 0df1b97e1b..2c8cb3df59 100644 --- a/docs/reference/action-types/Run/exec.md +++ b/docs/reference/action-types/Run/exec.md @@ -439,3 +439,19 @@ The full log output from the executed command. (Pro-tip: Make it machine readabl | -------- | ------- | | `string` | `""` | +### `${actions.run..outputs.stdout}` + +The stdout log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + +### `${actions.run..outputs.stderr}` + +The stderr log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + diff --git a/docs/reference/action-types/Test/exec.md b/docs/reference/action-types/Test/exec.md index 0a67f55e33..86edc2ed71 100644 --- a/docs/reference/action-types/Test/exec.md +++ b/docs/reference/action-types/Test/exec.md @@ -439,3 +439,19 @@ The full log output from the executed command. (Pro-tip: Make it machine readabl | -------- | ------- | | `string` | `""` | +### `${actions.test..outputs.stdout}` + +The stdout log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | + +### `${actions.test..outputs.stderr}` + +The stderr log output from the executed command. (Pro-tip: Make it machine readable so it can be parsed by dependants) + +| Type | Default | +| -------- | ------- | +| `string` | `""` | +