Skip to content

Commit

Permalink
feat: add step summary in code block
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Adams <[email protected]>
  • Loading branch information
jpadams committed Oct 30, 2024
1 parent 33170d0 commit 5e78c1a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ runs:
INPUT_MODULE: ${{ inputs.module }}
run: |
tmpout=$(mktemp)
# Run the command and capture its output in `tmpout`
# while also displaying it in the logs
cd ${{ inputs.workdir }} && { \
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
dagger \
Expand All @@ -83,8 +85,19 @@ runs:
${INPUT_MODULE:+-m $INPUT_MODULE} \
${{ inputs.args }}; } | tee "${tmpout}"
# Send the output to GITHUB_OUTPUT for further processing if needed
(echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"
# Append formatted output to GITHUB_STEP_SUMMARY
{
echo "### Dagger Output"
echo ""
echo "<pre><code>"
cat "${tmpout}"
echo "</code></pre>"
echo ""
} >> $GITHUB_STEP_SUMMARY
- if: inputs.engine-stop == 'true'
shell: bash
run: |
Expand Down

0 comments on commit 5e78c1a

Please sign in to comment.