Skip to content

Commit

Permalink
run_batch_script.yml: Fix grep checks by adding !
Browse files Browse the repository at this point in the history
`grep` returns 0 if found, and 1 if not found. But we want the opposite: 1 if warning/error
is present, and 0 if there are no warnings/errors. So, we need to invert the output code.

I have no idea why these checks lasted as long as they did without this `!` inversion. The
`grep` commands only used options `-iF`, meaning (case-insensitive) and (non-regex
strings), so the options don't have anything to do with it.

Hopefully this will fix the erroneous failures?
  • Loading branch information
joshuacwnewton committed Dec 7, 2024
1 parent 263189b commit 81d0f6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/run_batch_script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ jobs:
if: always()
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
# grep -iF "warning" process_data_sub-01.log
# ! grep -iF "warning" process_data_sub-01.log
- name: Check results (errors in log)
if: always()
run: |
cd "${{ github.event.repository.name }}/multi_subject/output/log"
grep -iF "error" process_data_sub-01.log
! grep -iF "error" process_data_sub-01.log

0 comments on commit 81d0f6a

Please sign in to comment.