55 */
66import * as core from "@actions/core" ;
77
8+ import {
9+ ActionName ,
10+ runInActions ,
11+ type Action ,
12+ type ActionState ,
13+ } from "./action-common" ;
814import * as actionsUtil from "./actions-util" ;
915import { getGitHubVersion } from "./api-client" ;
1016import * as debugArtifacts from "./debug-artifacts" ;
1117import { EnvVar } from "./environment" ;
12- import { getActionsLogger , withGroup } from "./logging" ;
18+ import { withGroup } from "./logging" ;
1319import { checkGitHubVersionInRange , getErrorMessage } from "./util" ;
1420
15- export async function runWrapper ( ) {
21+ /**
22+ * The main functionality of the `upload-sarif` post-action is implemented by this function.
23+ * This is called once by {@link runInActions} after it is called in {@link runWrapper}.
24+ */
25+ export async function run ( action : ActionState < [ "Logger" ] > ) {
1626 // To capture errors appropriately, keep as much code within the try-catch as
1727 // possible, and only use safe functions outside.
28+ const logger = action . logger ;
1829
1930 try {
20- const logger = getActionsLogger ( ) ;
21-
2231 // Restore inputs from `upload-sarif` Action.
2332 actionsUtil . restoreInputs ( logger ) ;
2433 const gitHubVersion = await getGitHubVersion ( ) ;
@@ -43,3 +52,14 @@ export async function runWrapper() {
4352 ) ;
4453 }
4554}
55+
56+ /** Defines the `upload-sarif` post-action. */
57+ const uploadSarifPostAction : Action = {
58+ name : ActionName . UploadSarifPost ,
59+ run,
60+ } ;
61+
62+ /** The main entry point for the `upload-sarif` post-action. */
63+ export async function runWrapper ( ) {
64+ await runInActions ( uploadSarifPostAction ) ;
65+ }
0 commit comments