Skip to content

Commit 829bba8

Browse files
committed
Do not download CLI
1 parent e08f131 commit 829bba8

4 files changed

Lines changed: 16 additions & 59 deletions

File tree

lib/resolve-environment-action.js

Lines changed: 6 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/resolve-environment-action.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resolve-environment/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: 'CodeQL: Resolve Build Environment'
22
description: '[Experimental] Attempt to infer a suitable environment configuration for the autobuilder'
33
author: 'GitHub'
44
inputs:
5-
tools:
6-
description: URL of CodeQL tools
7-
required: false
8-
# If not specified the Action will check in several places until it finds the CodeQL tools.
95
token:
106
default: ${{ github.token }}
117
matrix:

src/resolve-environment-action.ts

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,11 @@ import {
88
sendStatusReport,
99
} from "./actions-util";
1010
import { getGitHubVersion } from "./api-client";
11-
import { Features } from "./feature-flags";
12-
import { initCodeQL } from "./init";
11+
import * as configUtils from "./config-utils";
1312
import { Language, resolveAlias } from "./languages";
1413
import { getActionsLogger } from "./logging";
15-
import { parseRepositoryNwo } from "./repository";
1614
import { runResolveBuildEnvironment } from "./resolve-environment";
17-
import {
18-
checkForTimeout,
19-
checkGitHubVersionInRange,
20-
getRequiredEnvParam,
21-
wrapError,
22-
} from "./util";
15+
import { checkForTimeout, checkGitHubVersionInRange, wrapError } from "./util";
2316
import { validateWorkflow } from "./workflow";
2417

2518
const ACTION_NAME = "resolve-environment";
@@ -29,17 +22,6 @@ async function run() {
2922
const logger = getActionsLogger();
3023
const language: Language = resolveAlias(getRequiredInput("language"));
3124

32-
const apiDetails = {
33-
auth: getRequiredInput("token"),
34-
externalRepoAuth: getOptionalInput("external-repository-token"),
35-
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
36-
apiURL: getRequiredEnvParam("GITHUB_API_URL"),
37-
};
38-
39-
const repositoryNwo = parseRepositoryNwo(
40-
getRequiredEnvParam("GITHUB_REPOSITORY")
41-
);
42-
4325
try {
4426
const workflowErrors = await validateWorkflow(logger);
4527

@@ -59,29 +41,16 @@ async function run() {
5941
const gitHubVersion = await getGitHubVersion();
6042
checkGitHubVersionInRange(gitHubVersion, logger);
6143

62-
const features = new Features(
63-
gitHubVersion,
64-
repositoryNwo,
65-
getTemporaryDirectory(),
66-
logger
67-
);
68-
69-
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(
70-
gitHubVersion.type
71-
);
72-
73-
const initCodeQLResult = await initCodeQL(
74-
getOptionalInput("tools"),
75-
apiDetails,
76-
getTemporaryDirectory(),
77-
gitHubVersion.type,
78-
codeQLDefaultVersionInfo,
79-
logger
80-
);
44+
const config = await configUtils.getConfig(getTemporaryDirectory(), logger);
45+
if (config === undefined) {
46+
throw new Error(
47+
"Config file could not be found at expected location. Has the 'init' action been called?"
48+
);
49+
}
8150

8251
const workingDirectory = getOptionalInput("working-directory");
8352
const result = await runResolveBuildEnvironment(
84-
initCodeQLResult.codeql.getPath(),
53+
config.codeQLCmd,
8554
logger,
8655
workingDirectory,
8756
language

0 commit comments

Comments
 (0)