From 81d0f6adf538c55a07e6879cbf5794323ce3595f Mon Sep 17 00:00:00 2001 From: Joshua Newton Date: Fri, 6 Dec 2024 20:09:40 -0500 Subject: [PATCH] `run_batch_script.yml`: Fix `grep` checks by adding `!` `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? --- .github/workflows/run_batch_script.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_batch_script.yml b/.github/workflows/run_batch_script.yml index a53c613..4553393 100644 --- a/.github/workflows/run_batch_script.yml +++ b/.github/workflows/run_batch_script.yml @@ -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