mirror of
https://github.com/dagger/dagger-for-github.git
synced 2026-01-02 21:29:47 +11:00
stderr
Signed-off-by: Jeremy Adams <jeremy@dagger.io>
This commit is contained in:
parent
5e78c1aef2
commit
853159db1f
1 changed files with 26 additions and 14 deletions
36
action.yml
36
action.yml
|
|
@ -75,22 +75,24 @@ 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 \
|
||||
${{ inputs.dagger-flags }} \
|
||||
${{ inputs.verb }} \
|
||||
${INPUT_MODULE:+-m $INPUT_MODULE} \
|
||||
${{ inputs.args }}; } | tee "${tmpout}"
|
||||
tmperr=$(mktemp)
|
||||
|
||||
# Send the output to GITHUB_OUTPUT for further processing if needed
|
||||
# Run the command and capture stdout and stderr separately
|
||||
cd ${{ inputs.workdir }} && {
|
||||
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
|
||||
dagger \
|
||||
${{ inputs.dagger-flags }} \
|
||||
${{ inputs.verb }} \
|
||||
${INPUT_MODULE:+-m $INPUT_MODULE} \
|
||||
${{ inputs.args }}
|
||||
} >"${tmpout}" 2>"${tmperr}" # Redirect stdout to tmpout and stderr to tmperr
|
||||
|
||||
# Send stdout to GITHUB_OUTPUT
|
||||
(echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Append formatted output to GITHUB_STEP_SUMMARY
|
||||
# Append formatted stdout to GITHUB_STEP_SUMMARY
|
||||
{
|
||||
echo "### Dagger Output"
|
||||
echo "### Dagger stdout"
|
||||
echo ""
|
||||
echo "<pre><code>"
|
||||
cat "${tmpout}"
|
||||
|
|
@ -98,6 +100,16 @@ runs:
|
|||
echo ""
|
||||
} >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# Append formatted stderr to GITHUB_STEP_SUMMARY
|
||||
{
|
||||
echo "### Dagger stderr"
|
||||
echo ""
|
||||
echo "<pre><code>"
|
||||
cat "${tmperr}"
|
||||
echo "</code></pre>"
|
||||
echo ""
|
||||
} >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- if: inputs.engine-stop == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue