Skip to content

Commit 09d1768

Browse files
authored
fix(workflow): use check-runs
1 parent 17817f8 commit 09d1768

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/combine-prs.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)