-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Status check of PRs is broken #9
Comments
@algomaster99 could you please share how you fixed that issue? |
Hi @mherger ! I did something like this: if(${{ github.event.inputs.mustBeGreen }}) {
console.log('Checking green status: ' + branch);
- const statusResponse = await github.rest.repos.getCombinedStatusForRef({
+ const check_runs = await github.paginate('GET /repos/{owner}/{repo}/commits/{ref}/check-runs', {
owner: context.repo.owner,
repo: context.repo.repo,
ref: branch
});
- const state = statusResponse['data']['state'];
- console.log('Validating status: ' + state);
- if(state != 'success') {
- console.log('Discarding ' + branch + ' with status ' + state);
- statusOK = false;
+ for (const cr of check_runs.data.check_runs) {
+ console.log('Validating check conclusion: ' + cr.conclusion);
+ if(cr.conclusion != 'success') {
+ console.log('Discarding ' + branch + ' with check conclusion ' + cr.conclusion);
+ statusOK = false;
}
} |
Hey, the latest release, 1.3.0, uses a new API that checks the PR/branch status in a way that works both for statuses set with GitHub Actions CI, and external tools. As such this issue should be fixed now. If for any reason it doesn't work for you, let me know! |
Thanks @martingjaldbaek ! I will incorporate the latest changes in our workflow. |
Hey! Thanks for the workflow, first of all. I integrated it into https://github.com/SpoonLabs/sorald/ and it worked quite well. However, I had to fix the checking of CI status for each PR in the workflow. The URL here kept returning
pending
even though I am sure the CI was completed with exit code 0. This has also been reported on GitHub community forum.The text was updated successfully, but these errors were encountered: