Skip to content

Run poetry-check on push to main, so main stops showing 6/8 - #184

Merged
adamjohnwright merged 2 commits into
mainfrom
fix/poetry-check-on-main
Sep 9, 2026
Merged

adamjohnwright merged 2 commits into
mainfrom
fix/poetry-check-on-main

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

main has been showing 6/8 checks on every commit. The cause is not a failure — it is a skip.

poetry-check carried:

if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}

so a push to main skipped it, on both matrix legs. GitHub counts a skipped required check as not-passing, and poetry-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 both ubuntu-latest and macos-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 — push diffs HEAD^..HEAD, workflow_dispatch keeps 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:

event base_ref commit result
push — one that changed poetry.lock changed=true
push — one that did not changed=false
workflow_dispatch — HEAD changed=true
pull_request main HEAD changed=false

fetch-depth: 0 is already set, so HEAD^ resolves.

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.
@adamjohnwright
adamjohnwright merged commit 53c05e2 into main Sep 9, 2026
10 checks passed
@adamjohnwright
adamjohnwright deleted the fix/poetry-check-on-main branch September 9, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant