@@ -23,13 +23,17 @@ jobs:
23
23
- uses : actions/checkout@v3
24
24
- name : Run action (inputs only)
25
25
uses : ./
26
+ id : print_inputs
26
27
- name : Check output (inputs only)
27
28
run : |
28
- output=$(cat $GITHUB_STEP_SUMMARY)
29
- if [[ $output == *"test_name"* && $output == *"test_number"* ]]; then
29
+ echo "Action output:"
30
+ echo "${{ steps.print_inputs.outputs.output }}"
31
+
32
+ if [[ "${{ steps.print_inputs.outputs.output }}" == *"test_name"* && "${{ steps.print_inputs.outputs.output }}" == *"test_number"* ]]; then
30
33
echo "Test passed: Inputs were printed correctly"
31
34
else
32
35
echo "Test failed: Inputs were not printed as expected"
36
+ echo "Expected to find 'test_name' and 'test_number' in the output"
33
37
exit 1
34
38
fi
35
39
@@ -39,14 +43,20 @@ jobs:
39
43
- uses : actions/checkout@v3
40
44
- name : Run action (inputs and env vars)
41
45
uses : ./
46
+ id : print_inputs_and_env
42
47
with :
43
48
print_env_vars : ' true'
44
49
- name : Check output (inputs and env vars)
45
50
run : |
46
- output=$(cat $GITHUB_STEP_SUMMARY)
47
- if [[ $output == *"test_name"* && $output == *"test_number"* && $output == *"Printing environment variables:"* ]]; then
51
+ echo "Action output:"
52
+ echo "${{ steps.print_inputs_and_env.outputs.output }}"
53
+
54
+ if [[ "${{ steps.print_inputs_and_env.outputs.output }}" == *"test_name"* &&
55
+ "${{ steps.print_inputs_and_env.outputs.output }}" == *"test_number"* &&
56
+ "${{ steps.print_inputs_and_env.outputs.output }}" == *"Printing environment variables:"* ]]; then
48
57
echo "Test passed: Inputs and env vars were printed correctly"
49
58
else
50
59
echo "Test failed: Inputs or env vars were not printed as expected"
60
+ echo "Expected to find 'test_name', 'test_number', and 'Printing environment variables:' in the output"
51
61
exit 1
52
- fi
62
+ fi
0 commit comments