| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,11 @@ import { ActionsEnv, getActionsEnv } from "./actions-util"; | |||
| 4 | 4 | import { Env } from "./environment"; | |
| 5 | 5 | import { FeatureEnablement } from "./feature-flags"; | |
| 6 | 6 | import { getActionsLogger, Logger } from "./logging"; | |
| 7 | - import { ActionName, sendUnhandledErrorStatusReport } from "./status-report"; | ||
| 7 | + import { | ||
| 8 | + ActionName, | ||
| 9 | + getDisplayActionName, | ||
| 10 | + sendUnhandledErrorStatusReport, | ||
| 11 | + } from "./status-report"; | ||
| 8 | 12 | import { getEnv, getErrorMessage } from "./util"; | |
| 9 | 13 | ||
| 10 | 14 | /** Common state that is always available in `ActionState`. */ | |
@@ -83,7 +87,9 @@ export async function runInActions(action: Action) { | |||
| 83 | 87 | actions: actionsEnv, | |
| 84 | 88 | }); | |
| 85 | 89 | } catch (error) { | |
| 86 | - core.setFailed(`${action.name} action failed: ${getErrorMessage(error)}`); | ||
| 90 | + core.setFailed( | ||
| 91 | + `${getDisplayActionName(action.name)} action failed: ${getErrorMessage(error)}`, | ||
| 92 | + ); | ||
| 87 | 93 | await sendUnhandledErrorStatusReport(action.name, startedAt, error, logger); | |
| 88 | 94 | } | |
| 89 | 95 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -46,6 +46,17 @@ export enum ActionName { | |||
| 46 | 46 | UploadSarif = "upload-sarif", | |
| 47 | 47 | } | |
| 48 | 48 | ||
| 49 | + /** | ||
| 50 | + * Maps an `ActionName` to its display name. Usually that is the same, except | ||
| 51 | + * for `ActionName.Analyze` where it is `"analyze"` instead of `"finish"`. | ||
| 52 | + */ | ||
| 53 | + export function getDisplayActionName(actionName: ActionName): string { | ||
| 54 | + if (actionName === ActionName.Analyze) { | ||
| 55 | + return "analyze"; | ||
| 56 | + } | ||
| 57 | + return actionName; | ||
| 58 | + } | ||
| 59 | + | ||
| 49 | 60 | /** | |
| 50 | 61 | * @returns a boolean indicating whether the analysis is considered to be first party. | |
| 51 | 62 | * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments