mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Remove isTruthy: consistently use booleans in templates
This commit is contained in:
@@ -5,7 +5,7 @@ description: >
|
||||
autobuild Action.
|
||||
operatingSystems: ["ubuntu", "windows"]
|
||||
versions: ["linked", "nightly-latest"]
|
||||
installJava: "true"
|
||||
installJava: true
|
||||
env:
|
||||
CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING: true
|
||||
steps:
|
||||
|
||||
@@ -2,8 +2,8 @@ name: "Build mode autobuild"
|
||||
description: "An end-to-end integration test of a Java repository built using 'build-mode: autobuild'"
|
||||
operatingSystems: ["ubuntu", "windows"]
|
||||
versions: ["linked", "nightly-latest"]
|
||||
installJava: "true"
|
||||
installYq: "true"
|
||||
installJava: true
|
||||
installYq: true
|
||||
steps:
|
||||
- name: Set up Java test repo configuration
|
||||
run: |
|
||||
|
||||
@@ -34,12 +34,12 @@ interface Specification {
|
||||
/** Values for the `analysis-kinds` matrix dimension. */
|
||||
analysisKinds?: string[];
|
||||
|
||||
installNode?: string | boolean;
|
||||
installGo?: string | boolean;
|
||||
installJava?: string | boolean;
|
||||
installPython?: string | boolean;
|
||||
installDotNet?: string | boolean;
|
||||
installYq?: string | boolean;
|
||||
installNode?: boolean;
|
||||
installGo?: boolean;
|
||||
installJava?: boolean;
|
||||
installPython?: boolean;
|
||||
installDotNet?: boolean;
|
||||
installYq?: boolean;
|
||||
|
||||
/** Container image configuration for the job. */
|
||||
container?: any;
|
||||
@@ -113,13 +113,6 @@ function writeYaml(filePath: string, workflow: any): void {
|
||||
fs.writeFileSync(filePath, stripTrailingWhitespace(header + yamlStr), "utf8");
|
||||
}
|
||||
|
||||
function isTruthy(value: string | boolean | undefined): boolean {
|
||||
if (typeof value === "string") {
|
||||
return value.toLowerCase() === "true";
|
||||
}
|
||||
return Boolean(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip trailing whitespace from each line.
|
||||
*/
|
||||
@@ -220,7 +213,7 @@ function main(): void {
|
||||
},
|
||||
];
|
||||
|
||||
const installNode = isTruthy(checkSpecification.installNode);
|
||||
const installNode = checkSpecification.installNode;
|
||||
|
||||
if (installNode) {
|
||||
steps.push(
|
||||
@@ -252,7 +245,7 @@ function main(): void {
|
||||
},
|
||||
});
|
||||
|
||||
const installGo = isTruthy(checkSpecification.installGo);
|
||||
const installGo = checkSpecification.installGo;
|
||||
|
||||
if (installGo) {
|
||||
const baseGoVersionExpr = ">=1.21.0";
|
||||
@@ -276,7 +269,7 @@ function main(): void {
|
||||
});
|
||||
}
|
||||
|
||||
const installJava = isTruthy(checkSpecification.installJava);
|
||||
const installJava = checkSpecification.installJava;
|
||||
|
||||
if (installJava) {
|
||||
const baseJavaVersionExpr = "17";
|
||||
@@ -298,7 +291,7 @@ function main(): void {
|
||||
});
|
||||
}
|
||||
|
||||
const installPython = isTruthy(checkSpecification.installPython);
|
||||
const installPython = checkSpecification.installPython;
|
||||
|
||||
if (installPython) {
|
||||
const basePythonVersionExpr = "3.13";
|
||||
@@ -320,7 +313,7 @@ function main(): void {
|
||||
});
|
||||
}
|
||||
|
||||
const installDotNet = isTruthy(checkSpecification.installDotNet);
|
||||
const installDotNet = checkSpecification.installDotNet;
|
||||
|
||||
if (installDotNet) {
|
||||
const baseDotNetVersionExpr = "9.x";
|
||||
@@ -341,7 +334,7 @@ function main(): void {
|
||||
});
|
||||
}
|
||||
|
||||
const installYq = isTruthy(checkSpecification.installYq);
|
||||
const installYq = checkSpecification.installYq;
|
||||
|
||||
if (installYq) {
|
||||
steps.push({
|
||||
|
||||
Reference in New Issue
Block a user