File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments