Repository navigation
Open
Labels
blockedbugSomething isn't workingSomething isn't workinggh-prrelating to the gh pr commandrelating to the gh pr commandplatformProblems with the GitHub platform rather than the CLI clientProblems with the GitHub platform rather than the CLI clientpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic
Description
Describe the bug
To be honest, I'm not really sure that a bug report is right here! Please recategorize, close or move as you see fit!
My base branch pollicy prohibits merges when all checks aren't passing. I deleted a workflow file in a PR, and got GitHub into a bit of a stuck state where one of my checks was expected but wouldn't be run! While this is a weird state, I found it interesting that the CLI couldn't see this state. I would imagine that either gh pr checks or gh pr status would be able to detect that something is wrong with my PR, in the same way that the UI shows this information.
Steps to reproduce the behavior
ncx on brendon_backfill_decisions [$?] via 🐍 v3.10.4 (sequoia_ncx) on ☁️ (us-east-1) took 19s
❯ gh pr checks
All checks were successful
0 failing, 50 successful, 0 skipped, and 0 pending checks
✓ name_of_check 7m5s url
...
ncx on brendon_backfill_decisions [$?] via 🐍 v3.10.4 (sequoia_ncx) on ☁️ (us-east-1) took 9s
❯ gh pr status
Current branch
#1227 Given backfill decisions, remove ability to rea... [brendon_backfill_decisions]
✓ Checks passing ✓ 2 Approved
ncx on brendon_backfill_decisions [$?] via 🐍 v3.10.4 (sequoia_ncx) on ☁️ (us-east-1)
❯ gh pr merge -r
X Pull request #1227 is not mergeable: the base branch policy prohibits the merge.
To have the pull request merged after all the requirements have been met, add the `--auto` flag.
To use administrator privileges to immediately merge the pull request, add the `--admin` flag.
ncx on brendon_backfill_decisions [$?] via 🐍 v3.10.4 (sequoia_ncx) on ☁️ (us-east-1)
❯ gh pr merge -r --admin
Message: Required status check "cycle_close_plot_data / base" is expected., Locations: [{Line:1 Column:58}]
ncx on brendon_backfill_decisions [$?] via 🐍 v3.10.4 (sequoia_ncx) on ☁️ (us-east-1) took 3s
❯ gh --version
gh version 2.11.3 (2022-05-25)
https://github.com/cli/cli/releases/tag/v2.11.3
Expected vs actual behavior
I put this above!
Logs
I put the logs above!
Reacted by Piotr Stawarski, mor-akamai, Kristupas, Tinamaam and Dolev Hadar
Metadata
Metadata
Assignees
Labels
blockedbugSomething isn't workingSomething isn't workinggh-prrelating to the gh pr commandrelating to the gh pr commandplatformProblems with the GitHub platform rather than the CLI clientProblems with the GitHub platform rather than the CLI clientpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmetic

Activity
samcoe commentedon Oct 18, 2022
@BKDaugherty I suspect this is a platform bug where the API is not returning information about the stuck check. Could you run
gh pr checkswith theGH_DEBUG=apienvironment variable set and paste the logs here, redacting any sensitive information, so that we can further debug what is happening?BKDaugherty commentedon Oct 18, 2022
Is the body what we need here? Is there a way to get that?
samcoe commentedon Oct 20, 2022
@BKDaugherty The body is the part that we need but we have confirmed that this is a platform issue andt thus there isn't anything to be done from the CLI perspective since the API doesn't return the data necessary to display these checks.
dmelo commentedon Dec 21, 2022
I believe I ran into a similar issue. I recently changed my workflows and now, the new PRs have checks that are pending and never run. But when I run
gh pr checksandgh pr statusthe pending checks don't show up.I understand this is a platform issue. Is this issue being followed here or in some other issue? Is there a workaround?
dmelo commentedon Dec 28, 2022
Problem solved for me. In my case, those pending checks were explicitly specified on repo branch protection rules. After exluding those checks from the required checks list, everythning went back to normal again.
BKDaugherty commentedon Jan 11, 2023
@dmelo this is actually the same issue I ran into! It's fairly easy to get around this odd behavior by doing exactly as you suggested and removing the check from the branch protection rules. That being said, you need to have a good bit of understanding of what's going on to know that you need to do that! And, if you're only using the cli, it's hard to know that the check exists at all.
One way of making this more intuitive may be pulling the information for what checks are required in the branch protection rules and displaying that as a part of gh pr status or checks. That way the user can tell what they are missing from the cli alone
dmelo commentedon Jan 17, 2023
@BKDaugherty , I agree completely. Even though I was able to solve the issue for me, the current UI could be improved, so that others (and possibly my future self) don't lose time and energy on this like I did.
builtbysharath commentedon Oct 11, 2026
For anyone who lands here with a PR stuck on "Expected — Waiting for status to be reported": since the API doesn't list required checks that never reported, I wrote a small read-only workaround. It compares the base branch's required checks (classic branch protection and rulesets) with the check runs and commit statuses actually reported on the PR's head commit, then names the requirements that have no result.
Where it can, it also points at the likely cause: a workflow
paths/branchesfilter that excludes the PR, a job that was renamed, a check reported by a different GitHub App than the one required, or a success that only exists on an older commit. It only reads data through your existingghauth and changes nothing. Matrix and reusable-workflow job names aren't expanded yet.Disclosure: I'm the author. It's MIT-licensed and new, so if it gets your case wrong, an issue with the PR link would help: https://github.com/builtbysharath/gh-pr-check-explainer
resolve-thread reads what the base requires from the rulesets, so a c…
A withheld plain comment holds nothing, and a fix is green on its req…