Run poetry-check on push to main, so main stops showing 6/8 - #184
Merged
Merged
Conversation
poetry-check carried `if: github.event_name == 'pull_request' || 'workflow_dispatch'`, so a push to main skipped it. GitHub counts a skipped required check as not-passing, and `poetry-check (ubuntu-latest)` is one of the four required contexts -- so main has been showing 6/8 ever since. A main branch that always looks amber is a main branch nobody reads, which defeats the point of the gate. Removing the filter alone would have made the job expensive on every push: with no base_ref, the lockfile diff fell through to the "no base to compare against, so always verify" branch and would have run the full install-and-verify on every commit to main. A push does have something to compare against -- the commit before it -- so it now diffs HEAD^..HEAD and stays as cheap as it is on a PR. Simulated against real commits before pushing: push with a lock-changing commit -> true, push without -> false, workflow_dispatch -> true, pull_request base=main -> false.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
main has been showing 6/8 checks on every commit. The cause is not a failure — it is a skip.
poetry-checkcarried:so a push to
mainskipped it, on both matrix legs. GitHub counts a skipped required check as not-passing, andpoetry-check (ubuntu-latest)is one of the four required contexts. Hence 6/8, permanently.Why not just delete the
if:Because the job would then be expensive on every push. The lockfile diff reads
github.base_ref, which is empty outside a pull request, and the empty case fell through to "manual run: no base to compare against, so always verify" — the full Python + Poetry install and import verification, on bothubuntu-latestandmacos-15-intel, for every commit to main.A push does have something to compare against: the commit before it. So the empty-base case now splits —
pushdiffsHEAD^..HEAD,workflow_dispatchkeeps verifying unconditionally as it has nothing to compare against.Verification
The shell block was extracted and run against real commits in this repository, with the GitHub expressions substituted:
pushchanged=truepushchanged=falseworkflow_dispatchchanged=truepull_requestmainchanged=falsefetch-depth: 0is already set, soHEAD^resolves.