mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-22 01:53:24 +01:00
set another output for stderr as it will almost always contain 'some' data
This commit is contained in:
parent
5ee7b681bc
commit
11fa60953d
3 changed files with 8 additions and 9 deletions
|
@ -241,6 +241,8 @@ More advanced workflows may need to parse the resulting output of Wrangler comma
|
||||||
|
|
||||||
Now when you run your workflow, you will see the full output of the Wrangler command in your workflow logs. You can also use this output in subsequent workflow steps to parse the output for specific values.
|
Now when you run your workflow, you will see the full output of the Wrangler command in your workflow logs. You can also use this output in subsequent workflow steps to parse the output for specific values.
|
||||||
|
|
||||||
|
> Note: the `command-stderr` output variable is also available if you need to parse the standard error output of the Wrangler command.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### "I just started using Workers/Wrangler and I don't know what this is!"
|
### "I just started using Workers/Wrangler and I don't know what this is!"
|
||||||
|
|
|
@ -46,4 +46,6 @@ inputs:
|
||||||
required: false
|
required: false
|
||||||
outputs:
|
outputs:
|
||||||
command-output:
|
command-output:
|
||||||
description: "The output of the Wrangler command"
|
description: "The output of the Wrangler command (comes from stdout)"
|
||||||
|
command-stderr:
|
||||||
|
description: "The error output of the Wrangler command (comes from stderr)"
|
||||||
|
|
11
src/index.ts
11
src/index.ts
|
@ -264,14 +264,9 @@ async function wranglerCommands() {
|
||||||
// Execute the wrangler command
|
// Execute the wrangler command
|
||||||
await exec(`${packageManager.exec} wrangler ${command}`, args, options);
|
await exec(`${packageManager.exec} wrangler ${command}`, args, options);
|
||||||
|
|
||||||
// If stdOut contains data but stdErr does not, then save the stdOut value
|
// Set the outputs for the command
|
||||||
if (stdOut && (!stdErr || stdErr === "" || stdErr === undefined)) {
|
setOutput("command-output", stdOut);
|
||||||
info('saving stdout to "command-output" output')
|
setOutput("command-stderr", stdErr);
|
||||||
setOutput("command-output", stdOut);
|
|
||||||
} else if (stdErr) {
|
|
||||||
info('saving stderr to "command-output" output')
|
|
||||||
setOutput("command-output", stdErr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
endGroup();
|
endGroup();
|
||||||
|
|
Loading…
Reference in a new issue