Skip to content

Commit

Permalink
Update action distribution files
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored May 28, 2024
1 parent b2769bb commit abcec60
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions release/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39612,8 +39612,20 @@ async function getSuccess(inp) {
const { api, repoData } = inp;
const { owner, repo } = repoData;
const runID = process.env.GITHUB_RUN_ID;
const statusResponse = await api.rest.actions.listJobsForWorkflowRun({ owner, repo, run_id: parseInt(runID) });
const success = statusResponse.data.jobs.filter(job => (job.steps ?? []).filter(step => step.conclusion === 'failure').length > 0).length === 0;
const runAttempt = process.env.GITHUB_RUN_ATTEMPT;
const statusResponse = await api.rest.actions.listJobsForWorkflowRunAttempt({ owner, repo, run_id: parseInt(runID), attempt_number: parseInt(runAttempt) });
const jobs = statusResponse.data.jobs;
let success = true;
exit: for (const job of jobs) {
if (job.steps) {
for (const step of job.steps) {
if (step.conclusion === 'failure') {
success = false;
break exit;
}
}
}
}
console.log(`Workflow status is: ${success ? 'success' : 'failure'}`);
return success;
}
Expand Down

0 comments on commit abcec60

Please sign in to comment.