Skip to content

Commit

Permalink
Cross-check Go binary in analyze Action
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael B. Gale committed Oct 4, 2023
1 parent 2bd75f5 commit 4611ff9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/analyze-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions src/analyze-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 4611ff9

Please sign in to comment.