The GitHub Conundrum: When Checks Pass, But Merges Don't
Imagine this scenario: you've pushed a change to your feature branch, your GitHub Actions workflow runs, and gh pr checks --required confidently reports "PASS." All green! You're ready to merge, but then, GitHub's UI or GraphQL's mergeStateStatus insists your Pull Request (PR) is "BLOCKED." Frustrating, right? This isn't a rare glitch; it's a specific interaction within GitHub's branch protection rules and CI/CD check evaluations, particularly when dealing with concurrent workflow runs on the same head SHA.
Unpacking the Discrepancy: Display vs. Merge Gate
The core of the problem lies in how GitHub evaluates required checks for display versus for actual mergeability. As detailed in a recent community discussion , the required-check projection (what gh pr checks shows) often reads the "best completed check runs" for a given head SHA.…