From 5e78c1aef21a6767277783180988ef26be7626a0 Mon Sep 17 00:00:00 2001 From: Jeremy Adams Date: Wed, 30 Oct 2024 11:07:33 -0700 Subject: [PATCH] feat: add step summary in code block Signed-off-by: Jeremy Adams --- action.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/action.yml b/action.yml index c11a7c3..31d316d 100644 --- a/action.yml +++ b/action.yml @@ -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 \ @@ -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 "
"
+          cat "${tmpout}"
+          echo "
" + echo "" + } >> $GITHUB_STEP_SUMMARY + - if: inputs.engine-stop == 'true' shell: bash run: |