Stdout/stderr not available if action fails

Hi,

I’d like to post a comment, with the values of stdout/stderr for a specific run step.

Example config:

- name: Terraform Validate
  id: validate
  run: terraform validate -no-color
- uses: actions/github-script@0.9.0
  if: success() || failure()
  with:
    script: |
      const output = `#### Terraform Validation ${{ steps.validate.outputs.stdout }}`

stdout is properly populated when validate action succeeds, but stdout and stderr are empty, if action fails.

Is there a workaround to achieve this?

@deanrock,
The expression ${{ steps.<step id>.outputs.<output name> }} is used to access the output parameters set via the workflow command set-output or the Toolkit function core.setOutput in the previous steps in a job.
The output parameters only receive single line text as value. If you pass multi-line text to an output, only the first line is received.

  1. If the stdout/stderr is single line text, you can try using an output parameter to save and pass the stdout/stderr.
- name: Terraform Validate
  id: validate
  run: echo "::set-output name=stdout::$(terraform validate -no-color)"
  1. If the stdout/stderr is multi-line text, you can trying using a text file to save and pass the stdout/stderr.
- name: Terraform Validate
  run: terraform validate -no-color > stdout.txt

@deanrock,
How are things going? Is my suggestion helpful to you?
Please try it, and any updates, feel free to tell us.