tee both stdout and stderr

Signed-off-by: Jeremy Adams <jeremy@dagger.io>
This commit is contained in:
Jeremy Adams 2024-10-31 23:10:01 -07:00
parent b8e91e035e
commit 9c86de824d
No known key found for this signature in database
GPG key ID: EFAE55A5F386F0C2

View file

@ -77,16 +77,15 @@ runs:
tmpout=$(mktemp)
tmperr=$(mktemp)
# Run the command and capture stdout and stderr separately
cd ${{ inputs.workdir }} && {
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
dagger \
${{ inputs.dagger-flags }} \
${{ inputs.verb }} \
${INPUT_MODULE:+-m $INPUT_MODULE} \
${{ inputs.args }}
} >"${tmpout}" 2>"${tmperr}" # Redirect stdout to tmpout and stderr to tmperr
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
dagger \
${{ inputs.dagger-flags }} \
${{ inputs.verb }} \
${INPUT_MODULE:+-m $INPUT_MODULE} \
${{ inputs.args }}
} > >(tee "${tmpout}") 2> >(tee "${tmperr}" >&2)
# Send stdout to GITHUB_OUTPUT
(echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"