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 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-11-06 16:46:56 -07:00
1 parent 38faba92de
commit 9ed94347ae
1 file changed
+8
+8
View File
@@ -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