File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,15 @@ jobs:
5151 statusOK = true;
5252 if(${{ github.event.inputs.mustBeGreen }}) {
5353 console.log('Checking green status: ' + branch);
54- const statuses = await github.paginate('GET /repos/{owner}/{repo}/commits/{ref}/status ', {
54+ const statuses = await github.paginate('GET /repos/{owner}/{repo}/commits/{ref}/check-runs ', {
5555 owner: context.repo.owner,
5656 repo: context.repo.repo,
5757 ref: branch
5858 });
59- if(statuses.length > 0) {
60- const latest_status = statuses[0]['state'];
61- console.log('Validating status: ' + latest_status);
62- if(latest_status != 'success') {
63- console.log('Discarding ' + branch + ' with status ' + latest_status);
59+ for (const check of statuses) {
60+ console.log('Validating status: ' + check.name);
61+ if(check.conclusion != 'success') {
62+ console.log('Discarding ' + branch + ' because ' + check.name + '\'s conclusion is not success. It is: ' + check.conclusion);
6463 statusOK = false;
6564 }
6665 }
You can’t perform that action at this time.
0 commit comments