From 0db6c8a7dc85d704de5f52e54f7f1545c78bb0ad Mon Sep 17 00:00:00 2001 From: ktsiknos Date: Tue, 21 Apr 2026 12:11:20 +0200 Subject: [PATCH] fix(ci): propagate subprocess exit code and fail loop on error --- .github/workflows/sanity-check.yml | 1 + CI/post_filter.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index d33bf7a..0fbab59 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -50,6 +50,7 @@ jobs: - name: Run model checks if: steps.find_files.outputs.count != '0' run: | + set -e while read -r f; do [ -z "$f" ] && continue echo "Checking model: $f" diff --git a/CI/post_filter.py b/CI/post_filter.py index 837d1f5..13d6cad 100644 --- a/CI/post_filter.py +++ b/CI/post_filter.py @@ -48,6 +48,8 @@ def run_and_filter(cmd:str): except Exception: pass + return proc.returncode + def main(argv=None): p = argparse.ArgumentParser(prog='post_filter', description='Run command and filter its output') p.add_argument('cmd', nargs=argparse.REMAINDER, help='Command to run (use -- before the command)') @@ -63,7 +65,7 @@ def main(argv=None): if cmd and cmd[0] == '--': cmd = cmd[1:] - run_and_filter(cmd) + return run_and_filter(cmd) if __name__ == '__main__': sys.exit(main())