@@ -75,29 +75,41 @@ runs:
7575 INPUT_MODULE : ${{ inputs.module }}
7676 run : |
7777 tmpout=$(mktemp)
78- # Run the command and capture its output in `tmpout`
79- # while also displaying it in the logs
80- cd ${{ inputs.workdir }} && { \
81- DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
82- dagger \
83- ${{ inputs.dagger-flags }} \
84- ${{ inputs.verb }} \
85- ${INPUT_MODULE:+-m $INPUT_MODULE} \
86- ${{ inputs.args }}; } | tee "${tmpout}"
87-
88- # Send the output to GITHUB_OUTPUT for further processing if needed
78+ tmperr=$(mktemp)
79+
80+ # Run the command and capture stdout and stderr separately
81+ cd ${{ inputs.workdir }} && {
82+ DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
83+ dagger \
84+ ${{ inputs.dagger-flags }} \
85+ ${{ inputs.verb }} \
86+ ${INPUT_MODULE:+-m $INPUT_MODULE} \
87+ ${{ inputs.args }}
88+ } >"${tmpout}" 2>"${tmperr}" # Redirect stdout to tmpout and stderr to tmperr
89+
90+ # Send stdout to GITHUB_OUTPUT
8991 (echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"
90-
91- # Append formatted output to GITHUB_STEP_SUMMARY
92+
93+ # Append formatted stdout to GITHUB_STEP_SUMMARY
9294 {
93- echo "### Dagger Output "
95+ echo "### Dagger stdout "
9496 echo ""
9597 echo "<pre><code>"
9698 cat "${tmpout}"
9799 echo "</code></pre>"
98100 echo ""
99101 } >> $GITHUB_STEP_SUMMARY
100102
103+ # Append formatted stderr to GITHUB_STEP_SUMMARY
104+ {
105+ echo "### Dagger stderr"
106+ echo ""
107+ echo "<pre><code>"
108+ cat "${tmperr}"
109+ echo "</code></pre>"
110+ echo ""
111+ } >> $GITHUB_STEP_SUMMARY
112+
101113 - if : inputs.engine-stop == 'true'
102114 shell : bash
103115 run : |
0 commit comments