mirror of
https://github.com/dagger/dagger-for-github.git
synced 2026-01-01 05:00:21 +11:00
feat: add step summary in code block
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
This commit is contained in:
parent
33170d0344
commit
5e78c1aef2
1 changed files with 13 additions and 0 deletions
13
action.yml
13
action.yml
|
|
@ -75,6 +75,8 @@ runs:
|
||||||
INPUT_MODULE: ${{ inputs.module }}
|
INPUT_MODULE: ${{ inputs.module }}
|
||||||
run: |
|
run: |
|
||||||
tmpout=$(mktemp)
|
tmpout=$(mktemp)
|
||||||
|
# Run the command and capture its output in `tmpout`
|
||||||
|
# while also displaying it in the logs
|
||||||
cd ${{ inputs.workdir }} && { \
|
cd ${{ inputs.workdir }} && { \
|
||||||
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
|
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
|
||||||
dagger \
|
dagger \
|
||||||
|
|
@ -83,8 +85,19 @@ runs:
|
||||||
${INPUT_MODULE:+-m $INPUT_MODULE} \
|
${INPUT_MODULE:+-m $INPUT_MODULE} \
|
||||||
${{ inputs.args }}; } | tee "${tmpout}"
|
${{ inputs.args }}; } | tee "${tmpout}"
|
||||||
|
|
||||||
|
# Send the output to GITHUB_OUTPUT for further processing if needed
|
||||||
(echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"
|
(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'
|
- if: inputs.engine-stop == 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue