mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Use the common entry point for analyze
This commit is contained in:
1367
lib/entry-points.js
generated
1367
lib/entry-points.js
generated
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@ import { performance } from "perf_hooks";
|
|||||||
|
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
|
import { Action, ActionState, runInActions } from "./action-common";
|
||||||
import * as actionsUtil from "./actions-util";
|
import * as actionsUtil from "./actions-util";
|
||||||
import * as analyses from "./analyses";
|
import * as analyses from "./analyses";
|
||||||
import {
|
import {
|
||||||
@@ -40,7 +41,6 @@ import {
|
|||||||
createStatusReportBase,
|
createStatusReportBase,
|
||||||
DatabaseCreationTimings,
|
DatabaseCreationTimings,
|
||||||
getActionsStatus,
|
getActionsStatus,
|
||||||
sendUnhandledErrorStatusReport,
|
|
||||||
StatusReportBase,
|
StatusReportBase,
|
||||||
} from "./status-report";
|
} from "./status-report";
|
||||||
import {
|
import {
|
||||||
@@ -212,7 +212,7 @@ async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) {
|
|||||||
await runAutobuild(config, BuiltInLanguage.go, logger);
|
await runAutobuild(config, BuiltInLanguage.go, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function run(startedAt: Date) {
|
async function run({ startedAt, logger }: ActionState<["Logger"]>) {
|
||||||
// To capture errors appropriately, keep as much code within the try-catch as
|
// To capture errors appropriately, keep as much code within the try-catch as
|
||||||
// possible, and only use safe functions outside.
|
// possible, and only use safe functions outside.
|
||||||
|
|
||||||
@@ -228,7 +228,6 @@ async function run(startedAt: Date) {
|
|||||||
let didUploadTrapCaches = false;
|
let didUploadTrapCaches = false;
|
||||||
let dependencyCacheResults: DependencyCacheUploadStatusReport | undefined;
|
let dependencyCacheResults: DependencyCacheUploadStatusReport | undefined;
|
||||||
let databaseUploadResults: DatabaseUploadResult[] = [];
|
let databaseUploadResults: DatabaseUploadResult[] = [];
|
||||||
const logger = getActionsLogger();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
util.initializeEnvironment(actionsUtil.getActionVersion());
|
util.initializeEnvironment(actionsUtil.getActionVersion());
|
||||||
@@ -523,19 +522,13 @@ async function run(startedAt: Date) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Defines the `analyze` Action. */
|
||||||
|
const analyze: Action = {
|
||||||
|
name: ActionName.Analyze,
|
||||||
|
run,
|
||||||
|
};
|
||||||
|
|
||||||
export async function runWrapper() {
|
export async function runWrapper() {
|
||||||
const startedAt = new Date();
|
await runInActions(analyze);
|
||||||
const logger = getActionsLogger();
|
|
||||||
try {
|
|
||||||
await run(startedAt);
|
|
||||||
} catch (error) {
|
|
||||||
core.setFailed(`analyze action failed: ${util.getErrorMessage(error)}`);
|
|
||||||
await sendUnhandledErrorStatusReport(
|
|
||||||
ActionName.Analyze,
|
|
||||||
startedAt,
|
|
||||||
error,
|
|
||||||
logger,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await util.checkForTimeout();
|
await util.checkForTimeout();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user