mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-21 17:43:23 +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.
|
||||
|
||||
> Note: the `command-stderr` output variable is also available if you need to parse the standard error output of the Wrangler command.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "I just started using Workers/Wrangler and I don't know what this is!"
|
||||
|
|
|
@ -46,4 +46,6 @@ inputs:
|
|||
required: false
|
||||
outputs:
|
||||
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
|
||||
await exec(`${packageManager.exec} wrangler ${command}`, args, options);
|
||||
|
||||
// If stdOut contains data but stdErr does not, then save the stdOut value
|
||||
if (stdOut && (!stdErr || stdErr === "" || stdErr === undefined)) {
|
||||
info('saving stdout to "command-output" output')
|
||||
setOutput("command-output", stdOut);
|
||||
} else if (stdErr) {
|
||||
info('saving stderr to "command-output" output')
|
||||
setOutput("command-output", stdErr);
|
||||
}
|
||||
// Set the outputs for the command
|
||||
setOutput("command-output", stdOut);
|
||||
setOutput("command-stderr", stdErr);
|
||||
}
|
||||
} finally {
|
||||
endGroup();
|
||||
|
|
Loading…
Reference in a new issue