Skip to content

Commit bdc6d19

Browse files
authored
Update test.yaml
1 parent 44e6439 commit bdc6d19

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/test.yaml

+15-5
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ jobs:
2323
- uses: actions/checkout@v3
2424
- name: Run action (inputs only)
2525
uses: ./
26+
id: print_inputs
2627
- name: Check output (inputs only)
2728
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
3033
echo "Test passed: Inputs were printed correctly"
3134
else
3235
echo "Test failed: Inputs were not printed as expected"
36+
echo "Expected to find 'test_name' and 'test_number' in the output"
3337
exit 1
3438
fi
3539
@@ -39,14 +43,20 @@ jobs:
3943
- uses: actions/checkout@v3
4044
- name: Run action (inputs and env vars)
4145
uses: ./
46+
id: print_inputs_and_env
4247
with:
4348
print_env_vars: 'true'
4449
- name: Check output (inputs and env vars)
4550
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
4857
echo "Test passed: Inputs and env vars were printed correctly"
4958
else
5059
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"
5161
exit 1
52-
fi
62+
fi

0 commit comments

Comments
 (0)