Skip to content

Commit 683abe6

Browse files
committed
wip
1 parent 6173d52 commit 683abe6

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/validate.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@ jobs:
1414
with:
1515
github-token: ${{secrets.GITHUB_TOKEN}}
1616
script: |
17-
const { data: statuses } = await github.rest.repos.listCommitStatusesForRef({
18-
owner: context.repo.owner,
19-
repo: context.repo.repo,
20-
ref: 'main'
17+
const { owner, repo } = context.repo;
18+
const runs = await github.rest.actions.listWorkflowRuns({
19+
owner,
20+
repo,
21+
workflow_id: 'nightly.yaml',
22+
branch: 'main',
23+
status: 'completed'
2124
});
22-
23-
const latestFullValidation = statuses.find(status => status.context === 'nightly-full-validation');
24-
25-
if (!latestFullValidation || latestFullValidation.state !== 'success') {
26-
core.setFailed('Latest full validation was not successful');
25+
if (runs.data.workflow_runs.length === 0) {
26+
core.setFailed('No successful nightly runs found.');
27+
} else if (runs.data.workflow_runs[0].conclusion !== 'success') {
28+
core.setFailed(`Last nightly run failed. See: ${runs.data.workflow_runs[0].html_url}`);
2729
}
2830
2931
quick-validation:

0 commit comments

Comments
 (0)