From cddaacbc98f7bdca784606aff3dafb6e3ba205d3 Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Wed, 4 Oct 2023 00:37:02 +0000 Subject: [PATCH] [ci] invert the condition on all-jobs-succeed Previously, a failing job could cause all-jobs-succeed to be skipped, and branch protections interpreted a skipped job as being vacuously successful. This failure mode caused #454 to be merged to main, despite failing many CI checks. This PR inverts the `if` condition of this job: It only runs on failure, and upon failure, it fails. --- .github/workflows/ci.yml | 9 ++++----- README.md | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dc9ccb089..09764c592d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -443,11 +443,10 @@ jobs: cargo kani setup &> /dev/null || true # Used to signal to branch protections that all other jobs have succeeded. - all-jobs-succeed: - name: All checks succeeded - if: success() + no-jobs-failed: + name: No checks failed runs-on: ubuntu-latest needs: [build_test, kani, check_fmt, check_readme, check_msrv, check_versions, generate_cache] steps: - - name: Mark the job as successful - run: exit 0 + - name: Mark the job as unsuccessful + run: $exit ${{ success() && 0 || 1 }} diff --git a/README.md b/README.md index d9d3d907d2..9a2f09c8fc 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ WARNING: DO NOT EDIT THIS FILE. It is generated automatically. Edits should be made in the doc comment on `src/lib.rs` or in `generate-readme.sh`. --> +Hey CI, I'm updating the README manually, and you can't stop me! + # zerocopy *Want to help improve zerocopy?