Skip to content

Commit

Permalink
Set job status to success if analyze succeeded
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Jan 24, 2024
1 parent 42cc9a3 commit 0af1cd9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/init-action-post-helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action-post-helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/init-action-post.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ export async function tryUploadSarifIfRunFailed(
return createFailedUploadFailedSarifResult(e);
}
} else {
core.exportVariable(
EnvVar.JOB_STATUS,
process.env[EnvVar.JOB_STATUS] ?? JobStatus.Success,
);
return {
upload_failed_run_skipped_because:
"Analyze Action completed successfully",
Expand Down
4 changes: 2 additions & 2 deletions src/init-action-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ async function runWrapper() {
...statusReportBase,
...uploadFailedSarifResult,
job_status:
(process.env[EnvVar.JOB_STATUS] as JobStatus) ?? JobStatus.Success,
(process.env[EnvVar.JOB_STATUS] as JobStatus) ?? JobStatus.Unknown,
};
core.info(
`Sending job_status field as ${
(process.env[EnvVar.JOB_STATUS] as JobStatus) ?? JobStatus.Success
(process.env[EnvVar.JOB_STATUS] as JobStatus) ?? JobStatus.Unknown
}`,
);
await sendStatusReport(statusReport);
Expand Down

0 comments on commit 0af1cd9

Please sign in to comment.