From 9ed94347ae709e5e7433b9d081ae45e0988feb03 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Fri, 6 Nov 2026 16:46:56 -0700 Subject: [PATCH] ci: the parity floor compares a push against the branch's tip before it HEAD^1 is only the new tip's parent: a push of several commits could lower the floor in an earlier one and pass. github.event.before is what main was before the push; a new branch (all zeros) falls back to HEAD^1. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/check.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e6ad869d..14248490 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -42,10 +42,18 @@ jobs: # docs/parity.md's floor never decreases (AGENTS.md, "Parity # tracking"); a test checks it inside `just check`, this checks the # commit's floor against its base. + # A push compares against the branch's tip before the push, not the + # new tip's parent: a push of several commits could otherwise lower + # the floor in an earlier one unseen. - name: The parity floor holds + env: + BEFORE: ${{ github.event.before }} run: | if [ "${{ github.event_name }}" = "pull_request" ]; then scripts/parity-floor.sh "origin/${{ github.base_ref }}" + elif [ -n "$BEFORE" ] && [ "$BEFORE" != 0000000000000000000000000000000000000000 ] \ + && git fetch --no-tags --depth=1 origin "$BEFORE"; then + scripts/parity-floor.sh "$BEFORE" else scripts/parity-floor.sh HEAD^1 fi