Skip to content

Commit

Permalink
Consider unsuccessful analysis in non-Action step config error
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Jan 24, 2024
1 parent 8b31be2 commit 2059487
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 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.

9 changes: 5 additions & 4 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ export async function tryUploadSarifIfRunFailed(
logger: Logger,
): Promise<UploadFailedSarifResult> {
if (process.env[EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY] !== "true") {
// At this point, if the job status has not been set previously, but we
// know that analyze didn't complete successfully, we consider the job
// failed — we can't tell if the failure was due to configuration error.
// If analyze didn't complete successfully and the job status hasn't
// already been set to Failure/ConfigurationError previously, this
// means that something along the way failed in a step that is not
// owned by the Action. This is considered configuration error.
core.exportVariable(
EnvVar.JOB_STATUS,
process.env[EnvVar.JOB_STATUS] ?? JobStatus.Failure,
process.env[EnvVar.JOB_STATUS] ?? JobStatus.ConfigurationError,
);
try {
return await maybeUploadFailedSarif(
Expand Down

0 comments on commit 2059487

Please sign in to comment.