Cross-check Go binary in analyze Action

This commit is contained in:
Michael B. Gale 2023-09-28 11:46:36 +01:00
parent 2bd75f528c
commit 4611ff9b23
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
3 changed files with 24 additions and 1 deletions

View file

@ -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(