Skip to content

Commit f9a4c9f

Browse files
committed
tests: add test for multiline output
Signed-off-by: Justin Chadwell <[email protected]>
1 parent e3a863e commit f9a4c9f

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/test.yml

+43
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,49 @@ permissions:
1717
pull-requests: write
1818

1919
jobs:
20+
output:
21+
runs-on: "ubuntu-latest"
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: "Use output"
26+
id: use-output
27+
uses: ./
28+
with:
29+
version: latest
30+
verb: core
31+
args: container from --address=alpine with-exec --args echo,"hello world" stdout
32+
- name: "Use output (check)"
33+
run: |
34+
target='${{ steps.use-output.outputs.output }}'
35+
if [[ "$target" == "hello world" ]]; then
36+
echo "matches"
37+
exit 0
38+
else
39+
echo "does not match"
40+
exit 1
41+
fi
42+
43+
- name: "Use multiline output"
44+
id: use-multiline-output
45+
uses: ./
46+
with:
47+
version: latest
48+
verb: core
49+
args: container from --address=alpine with-exec --args echo,-e,"hello\nworld" stdout
50+
- name: "Use output (check)"
51+
run: |
52+
target='${{ steps.use-multiline-output.outputs.output }}'
53+
result='hello
54+
world'
55+
if [[ "$target" == "$result" ]]; then
56+
echo "matches"
57+
exit 0
58+
else
59+
echo "does not match"
60+
exit 1
61+
fi
62+
2063
version:
2164
runs-on: "ubuntu-latest"
2265
steps:

0 commit comments

Comments
 (0)