From 4ccbd24b971f122c51d8505f0fe6631323cd2b6d Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 30 Jan 2026 15:05:23 -0800 Subject: [PATCH] Use 'not success' checks instead of specific failure conditions Change the checks job to test for 'result != success' instead of explicitly checking for 'cancelled' or 'failure' states. This is safer because: 1. It catches all non-success states (cancelled, failure, skipped, or any unexpected future states that GitHub might introduce) 2. It follows a 'fail closed' approach: if we don't know the state is success, we fail 3. It's simpler and more maintainable than listing specific failure conditions The possible values for needs..result are: success, failure, cancelled, or skipped. By checking for 'not success', we ensure we catch any unexpected states and err on the safer side. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80d8cc7ba2..1d4b246a40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -243,16 +243,16 @@ jobs: # Note: When [doc-only] is in PR title, test jobs are intentionally # skipped and should not cause failure. doc_only=${{ needs.should-skip.outputs.doc-only }} - if ${{ needs.doc.result == 'cancelled' || needs.doc.result == 'failure' }}; then + # Fail if doc job didn't succeed (covers cancelled, failure, skipped, or any unexpected state) + if ${{ needs.doc.result != 'success' }}; then exit 1 fi if [[ "${doc_only}" != "true" ]]; then - if ${{ needs.test-linux-64.result == 'cancelled' || - needs.test-linux-64.result == 'failure' || - needs.test-linux-aarch64.result == 'cancelled' || - needs.test-linux-aarch64.result == 'failure' || - needs.test-windows.result == 'cancelled' || - needs.test-windows.result == 'failure' }}; then + # Fail if any test job didn't succeed (covers cancelled, failure, skipped, or any unexpected state) + # When doc_only != "true", test jobs should have run, so any non-success state is a failure + if ${{ needs.test-linux-64.result != 'success' || + needs.test-linux-aarch64.result != 'success' || + needs.test-windows.result != 'success' }}; then exit 1 fi fi