I have the 2 following GitHub Actions steps.
The first one checks if at least one of 2 files is empty and sets a step output to 1 if so. The second one is executed based on this condition.
- name: check if any results were found
if: github.event.pull_request.merged == true
id: check-results
shell: bash
run: |
if [ -s fileA ] || [ -s fileB ]; then
echo "Results found"
echo "found=1" > results
else
echo "No results found"
echo "found=0" > results
fi
- name: send slack notificationq
if: ${{ steps.check-results.outputs.found == 1 }} && github.event.pull_request.merged == true
shell: bash
run: |
echo ${{ steps.check-results.outputs.found }}
echo "Results found"
cat results
Why does the second one gets executed given that the logs explicitly show that ${{ steps.check-results.outputs.found }}
is equal to 0
?