Skip to content

Commit

Permalink
Set Cancel status to Failure
Browse files Browse the repository at this point in the history
instead of success.
  • Loading branch information
bansan85 committed Jul 5, 2022
1 parent 23ed029 commit 1a84392
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ function job2status(job, isCleanUp) {
if (!isCleanUp) {
return 'pending';
}
if (!job.steps) {
return 'success';
}
for (const value of job.steps) {
if (!value.conclusion)
continue;
core.info(value.conclusion);
}
// Find step with failure instead of relying on job.conclusion because this
// (post) action itself is one of a step of this job and job.conclusion is
// always null while running this action.
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,17 @@ function job2status(
if (!isCleanUp) {
return 'pending'
}
if (!job.steps) {
return 'success'
}
for (const value of job.steps) {
if (!value.conclusion) continue
core.info(value.conclusion)
}
// Find step with failure instead of relying on job.conclusion because this
// (post) action itself is one of a step of this job and job.conclusion is
// always null while running this action.
const failedStep = job.steps!.find(step => step.conclusion === 'failure')
const failedStep = job.steps.find(step => step.conclusion === 'failure')
if (failedStep) {
return 'failure'
}
Expand Down

0 comments on commit 1a84392

Please sign in to comment.