Cross-check Go binary in analyze Action
This commit is contained in:
parent
2bd75f528c
commit
4611ff9b23
3 changed files with 24 additions and 1 deletions
9
lib/analyze-action.js
generated
9
lib/analyze-action.js
generated
|
|
@ -31,6 +31,7 @@ const fs = __importStar(require("fs"));
|
|||
const path_1 = __importDefault(require("path"));
|
||||
const perf_hooks_1 = require("perf_hooks");
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const safe_which_1 = require("@chrisgavin/safe-which");
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const analyze_1 = require("./analyze");
|
||||
const api_client_1 = require("./api-client");
|
||||
|
|
@ -159,6 +160,14 @@ async function run() {
|
|||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
||||
const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, actionsUtil.getTemporaryDirectory(), logger);
|
||||
const memory = util.getMemoryFlag(actionsUtil.getOptionalInput("ram") || process.env["CODEQL_RAM"], logger);
|
||||
// Check that the Go wrapper script still exists, if set
|
||||
const goWrapperPath = process.env[environment_1.EnvVar.GO_BINARY_LOCATION];
|
||||
if (goWrapperPath !== undefined) {
|
||||
const goBinaryPath = await (0, safe_which_1.safeWhich)("go");
|
||||
if (goWrapperPath !== goBinaryPath) {
|
||||
core.warning("Unexpected result for `which go`: please ensure that the correct version of Go is installed before the `codeql-action/init` Action is used.");
|
||||
}
|
||||
}
|
||||
await runAutobuildIfLegacyGoWorkflow(config, logger);
|
||||
dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, features);
|
||||
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -3,6 +3,7 @@ import path from "path";
|
|||
import { performance } from "perf_hooks";
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import { safeWhich } from "@chrisgavin/safe-which";
|
||||
|
||||
import * as actionsUtil from "./actions-util";
|
||||
import {
|
||||
|
|
@ -231,6 +232,19 @@ async function run() {
|
|||
logger,
|
||||
);
|
||||
|
||||
// Check that the Go wrapper script still exists, if set
|
||||
const goWrapperPath = process.env[EnvVar.GO_BINARY_LOCATION];
|
||||
|
||||
if (goWrapperPath !== undefined) {
|
||||
const goBinaryPath = await safeWhich("go");
|
||||
|
||||
if (goWrapperPath !== goBinaryPath) {
|
||||
core.warning(
|
||||
"Unexpected result for `which go`: please ensure that the correct version of Go is installed before the `codeql-action/init` Action is used.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await runAutobuildIfLegacyGoWorkflow(config, logger);
|
||||
|
||||
dbCreationTimings = await runFinalize(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue