fix: pr approve-align-files evaluates GitHub Actions check_runs#1771
Open
fix: pr approve-align-files evaluates GitHub Actions check_runs#1771
Conversation
Previously the loop over check_runs was skipped when combinedStatus state was 'success' or 'failure'. combinedStatus only reflects legacy commit statuses (e.g. CircleCI), so a green CircleCI made the tool ignore failing GitHub Actions checks like 'pre-commit', causing PRs to be approved (and auto-merged on repos without required status checks) despite real failures. Made-with: Cursor
Member
Author
|
@marians a follow-up of the pre-commit fixes. approve-align-files approved all the PRs although pre-commit was failing for a real reason. This was unexpected for my worflow because my agent would have started agents to fix the real issues. now they all got merged because of auto-merge and pre-commit not being in the list of required_status_checks. this here would be a quick fix to avoid this in the future. but I guess making pre-commit mandatory is the better fix. wdyt? |
marians
approved these changes
Apr 23, 2026
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.
Problem
devctl pr approve-align-fileswas approving and (via GitHub auto-merge on repos without required status checks) merging Align files PRs that had a failingpre-commitGitHub Actions check, as long as the legacy commit statuses (e.g. CircleCI) were green.Concrete example today: `giantswarm/mcp-kubernetes#375` was merged with a failing `pre-commit` check because all `ci/circleci: ...` checks were `success`.
Root cause
In `cmd/pr/approvealign/runner.go`, the `check_runs` evaluation loop was gated on `combinedStatus` not having a definitive answer:
```go
if combinedStatus == nil || (combinedStatus.GetState() != "success" && combinedStatus.GetState() != "failure") {
for _, run := range checkRuns.CheckRuns { ... }
}
```
GitHub exposes two separate APIs for PR status:
A green CircleCI made the loop skip entirely, so failing Actions checks were invisible to the tool.
Fix
Always iterate `check_runs` and let any failing run set `hasFailedChecks = true` (or any pending run set `checksPending = true`). The outer `!hasFailedChecks` guard still short-circuits if combinedStatus already detected a failure, so we don't do redundant work.
Test plan
Made with Cursor