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:
Where should I check first to resolve this?
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
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.
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:
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.
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:
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:Case closed.
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:
git fetch origin pull/{id}/head:temporary
git push origin temporary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With