Skip to content

Commit c21e1dd

Browse files
committed
Lint and build
1 parent 53bed11 commit c21e1dd

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

lib/autobuild.js

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

lib/autobuild.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.

src/autobuild.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as core from "@actions/core";
22

3-
import { getTemporaryDirectory } from "./actions-util";
3+
import { getTemporaryDirectory, getWorkflowEventName } from "./actions-util";
44
import { getGitHubVersion } from "./api-client";
55
import { CodeQL, getCodeQL } from "./codeql";
66
import * as configUtils from "./config-utils";
@@ -101,6 +101,8 @@ export async function determineAutobuildLanguages(
101101
async function setupCppAutobuild(codeql: CodeQL, logger: Logger) {
102102
const envVar = featureConfig[Feature.CppDependencyInstallation].envVar;
103103
const featureName = "C++ automatic installation of dependencies";
104+
const envDoc =
105+
"https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow";
104106
const gitHubVersion = await getGitHubVersion();
105107
const repositoryNwo = parseRepositoryNwo(
106108
getRequiredEnvParam("GITHUB_REPOSITORY"),
@@ -117,10 +119,18 @@ async function setupCppAutobuild(codeql: CodeQL, logger: Logger) {
117119
process.env["RUNNER_ENVIRONMENT"] === "self-hosted" &&
118120
process.env[envVar] !== "true"
119121
) {
120-
logger.info(`Disabling ${featureName} as we are on a self-hosted runner.` + getWorkflowEventName() !== "dynamic" ? ` To override this, set the ${envVar} environment variable to 'true' in your workflow (see https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow).` : "");
122+
logger.info(
123+
`Disabling ${featureName} as we are on a self-hosted runner.${
124+
getWorkflowEventName() !== "dynamic"
125+
? ` To override this, set the ${envVar} environment variable to 'true' in your workflow (see ${envDoc}).`
126+
: ""
127+
}`,
128+
);
121129
core.exportVariable(envVar, "false");
122130
} else {
123-
logger.info(`Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false' (see https://docs.github.com/en/actions/learn-github-actions/variables#defining-environment-variables-for-a-single-workflow).`);
131+
logger.info(
132+
`Enabling ${featureName}. This can be disabled by setting the ${envVar} environment variable to 'false' (see ${envDoc}).`,
133+
);
124134
core.exportVariable(envVar, "true");
125135
}
126136
} else {

0 commit comments

Comments
 (0)