Skip to content

Commit

Permalink
Also create a check run where no GHA check runs exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi committed Oct 18, 2023
1 parent 950c7b1 commit 4510275
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/check-required.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,13 @@ jobs:
check_name: ghaName,
});
if (ghaChecks.length === 0) {
core.warning(`No GitHub Actions check run found for ${sha}.`);
return;
}
var newCheck = {
owner: owner,
repo: repo,
name: myName,
head_sha: sha,
status: 'in_progress',
started_at: ghaChecks[0].started_at,
started_at: context.payload.workflow_run.created_at,
output: {
title: 'Not all required checks succeeded',
},
Expand All @@ -86,6 +81,9 @@ jobs:
newCheck.started_at = check.started_at;
}
});
if (ghaChecks.length === 0) {
core.summary.addRaw(`No check runs for ${sha} found.`);
}
newCheck.output.summary = core.summary.stringify();
await core.summary.write();
Expand Down

0 comments on commit 4510275

Please sign in to comment.