Skip to content

Commit

Permalink
feat: add output for action
Browse files Browse the repository at this point in the history
To chain on from the github action, it's very useful to be able to get
the output from an action.

Signed-off-by: Justin Chadwell <[email protected]>
  • Loading branch information
jedevc committed Oct 25, 2024
1 parent fdc7b3a commit 1a00b8f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ inputs:
description: "Whether to stop the Dagger Engine after this run"
required: false
default: "true"
outputs:
output:
description: "Job output"
value: ${{ steps.exec.outputs.stdout }}
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -65,17 +69,21 @@ runs:
curl -fsS https://dl.dagger.io/dagger/install.sh \
| BIN_DIR=${prefix_dir}/bin DAGGER_VERSION="$VERSION" DAGGER_COMMIT="$COMMIT" sh
- shell: bash
- id: exec
shell: bash
env:
INPUT_MODULE: ${{ inputs.module }}
run: |
tmpout=$(mktemp)
cd ${{ inputs.workdir }} && { \
DAGGER_CLOUD_TOKEN=${{ inputs.cloud-token }} \
dagger \
${{ inputs.dagger-flags }} \
${{ inputs.verb }} \
${INPUT_MODULE:+-m $INPUT_MODULE} \
${{ inputs.args }}; }
${{ inputs.args }}; } | tee "${tmpout}"
(echo -n "stdout=" && cat "${tmpout}") >> "$GITHUB_OUTPUT"
- if: inputs.engine-stop == 'true'
shell: bash
Expand Down

0 comments on commit 1a00b8f

Please sign in to comment.