mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 17:39:50 +00:00
Use runInActions for the start-proxy post-action
This commit is contained in:
@@ -5,18 +5,28 @@
|
||||
*/
|
||||
import * as core from "@actions/core";
|
||||
|
||||
import {
|
||||
ActionName,
|
||||
runInActions,
|
||||
type Action,
|
||||
type ActionState,
|
||||
} from "./action-common";
|
||||
import * as actionsUtil from "./actions-util";
|
||||
import { getGitHubVersion } from "./api-client";
|
||||
import * as configUtils from "./config-utils";
|
||||
import { uploadArtifacts } from "./debug-artifacts";
|
||||
import { getActionsLogger } from "./logging";
|
||||
import { getSafeErrorMessage } from "./start-proxy/status-report";
|
||||
import { checkGitHubVersionInRange, getErrorMessage } from "./util";
|
||||
|
||||
export async function runWrapper() {
|
||||
/**
|
||||
* The main functionality of the `start-proxy` post-action is implemented by this function.
|
||||
* This is called once by {@link runInActions} after it is called in {@link runWrapper}.
|
||||
*/
|
||||
export async function run(action: ActionState<["Logger"]>) {
|
||||
// To capture errors appropriately, keep as much code within the try-catch as
|
||||
// possible, and only use safe functions outside.
|
||||
|
||||
const logger = getActionsLogger();
|
||||
const logger = action.logger;
|
||||
|
||||
try {
|
||||
// Restore inputs from `start-proxy` Action.
|
||||
@@ -56,3 +66,15 @@ export async function runWrapper() {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/** Defines the `start-proxy` post-action. */
|
||||
const startProxyPostAction: Action = {
|
||||
name: ActionName.StartProxyPost,
|
||||
run,
|
||||
transformTelemetryError: getSafeErrorMessage,
|
||||
};
|
||||
|
||||
/** The main entry point for the `start-proxy` post-action. */
|
||||
export async function runWrapper() {
|
||||
await runInActions(startProxyPostAction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user