Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github pull request - Waiting for status to be reported

Tags:

github

I have a pull request, build passed on VSTS, but another check "Expected - Waiting for status to be reported" never succeeds, no matter how many times I try to trigger build. I had many other pull requests with no issues.

I am not sure how to tackle this problem, how to debug this? There is no specific info than this: enter image description here

Where should I check first to resolve this?

like image 931
sensei Avatar asked Sep 06 '18 08:09

sensei


4 Answers

This can happen sometimes, what you can do is to push an empty commit to the branch of the PR. It will re-trigger all the checks you have in CI. This can be done using git command.

git commit --amend --no-edit

and then force push your branch.

git push -f
like image 194
Sam Avatar answered Oct 18 '22 22:10

Sam


The simplest solution for me was closing the PR and opening it again. After that, checks where executed as expected.

There's a button on GitHub that makes it very easy.

enter image description here

like image 21
Bernat Avatar answered Oct 18 '22 23:10

Bernat


TL;DR

If this status check is necessary before merging, use a Personal Access Token instead of the default secrets.GITHUB_TOKEN for creating this PR in your github action:

- name: Create Pull Request
  uses: peter-evans/create-pull-request@v3
  with:
    token: ${{ secrets.YOUR_PAT }}

If not, simply uncheck this under repo setting, in your protected branch:

enter image description here

Reasons

There're restrictions on github actions triggering other github actions, by design. So if you have the setting x must pass before branch can be merged, some actions could get stuck in limbo forever.

This is also why "push an empty commit" or "close and reopen the PR" can unstuck it--because then the PR is no longer purely action triggered. This is also why switching to PAT works, because using secrets.GITHUB_TOKEN implies this PR is github-action-initiated. While using a PAT, it's initiated by a user.

How to debug

I am not sure how to tackle this problem, how to debug this? There is no specific info than this: waiting for status to be reported

I find other people's debugging process generally more illuminating than the solutions themselves, so, glad you asked! Here's how I came to my conclusions:

  • From googling "Expected — Waiting for status to be reported", I got to this top result, where ​I found the above setting change vaguely described in the comments.
  • Then from reading the description of this setting, I understood it to mean that the reason I see this status is because I've configured for it to must pass before any branch can be merged, but for some reason this branch does not trigger it.
  • So I considered what made this branch different from all the other branches that were triggering correctly. One big difference is that this PR is triggered by another action. Running with this theory, I googled "github action doesn't trigger when PR created by bot", and got this first result, which explained why.
  • Finally I double checked other similar actions in other repos, and curiously, some action triggered PRs had runs below, but some don't. I compared their definitions, and noticed that the limboed ones were using secrets.GITHUB_TOKEN as token when creating PR, while the correct ones were using PAT. And indeed those PRs were headed by this octopus while the correct ones were headed by user icons:

enter image description here

Case closed.

like image 22
Lucia Avatar answered Oct 18 '22 22:10

Lucia


I found a workaround! You need to create a new PR for the same commit using different branch name. This will kick the build upon completion both original and new PR will get status update. Then you can merge the original and close the new one.

If PR was created from remote repository you can pull the ref to your repository locally by following these instructions:

  • https://help.github.com/articles/checking-out-pull-requests-locally/
git fetch origin pull/{id}/head:temporary
git push origin temporary
like image 9
StanislawSwierc Avatar answered Oct 18 '22 23:10

StanislawSwierc