Skip to content

Commit

Permalink
tests: add test for multiline output
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Chadwell <[email protected]>
  • Loading branch information
jedevc committed Nov 11, 2024
1 parent a320953 commit 347ab70
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,49 @@ permissions:
pull-requests: write

jobs:
output:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4

- name: "Use output"
id: use-output
uses: ./
with:
version: latest
verb: core
args: container from --address=alpine with-exec --args echo,"hello world" stdout
- name: "Use output (check)"
run: |
target='${{ steps.use-output.outputs.output }}'
if [[ "$target" == "hello world" ]]; then
echo "matches"
exit 0
else
echo "does not match"
exit 1
fi
- name: "Use multiline output"
id: use-multiline-output
uses: ./
with:
version: latest
verb: core
args: container from --address=alpine with-exec --args echo,-e,"hello\nworld" stdout
- name: "Use output (check)"
run: |
target='${{ steps.use-multiline-output.outputs.output }}'
result='hello
world'
if [[ "$target" == "$result" ]]; then
echo "matches"
exit 0
else
echo "does not match"
exit 1
fi
version:
runs-on: "ubuntu-latest"
steps:
Expand Down

0 comments on commit 347ab70

Please sign in to comment.