Skip to content

Commit 5e78c1a

Browse files
committed
feat: add step summary in code block
Signed-off-by: Jeremy Adams <[email protected]>
1 parent 33170d0 commit 5e78c1a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ 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
7880
cd ${{ inputs.workdir }} && { \
7981
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
8082
dagger \
@@ -83,8 +85,19 @@ runs:
8385
${INPUT_MODULE:+-m $INPUT_MODULE} \
8486
${{ inputs.args }}; } | tee "${tmpout}"
8587
88+
# Send the output to GITHUB_OUTPUT for further processing if needed
8689
(echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"
8790
91+
# Append formatted output to GITHUB_STEP_SUMMARY
92+
{
93+
echo "### Dagger Output"
94+
echo ""
95+
echo "<pre><code>"
96+
cat "${tmpout}"
97+
echo "</code></pre>"
98+
echo ""
99+
} >> $GITHUB_STEP_SUMMARY
100+
88101
- if: inputs.engine-stop == 'true'
89102
shell: bash
90103
run: |

0 commit comments

Comments
 (0)