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