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:
1 parent
38faba92de
commit
9ed94347ae
1 file changed
+8
@@ -42,10 +42,18 @@ jobs:
|
|||||||
# docs/parity.md's floor never decreases (AGENTS.md, "Parity
|
# docs/parity.md's floor never decreases (AGENTS.md, "Parity
|
||||||
# tracking"); a test checks it inside `just check`, this checks the
|
# tracking"); a test checks it inside `just check`, this checks the
|
||||||
# commit's floor against its base.
|
# 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
|
- name: The parity floor holds
|
||||||
|
env:
|
||||||
|
BEFORE: ${{ github.event.before }}
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
if [ "${{ github.event_name }}" = "pull_request" ]; then
|
||||||
scripts/parity-floor.sh "origin/${{ github.base_ref }}"
|
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
|
else
|
||||||
scripts/parity-floor.sh HEAD^1
|
scripts/parity-floor.sh HEAD^1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user