mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 01:08:46 +00:00
Linting: Prefer optional chaining
This commit is contained in:
Generated
+3
-3
@@ -91887,13 +91887,13 @@ async function getTarVersion() {
|
||||
}
|
||||
if (stdout.includes("GNU tar")) {
|
||||
const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match[1] };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match[1] };
|
||||
@@ -92273,7 +92273,7 @@ function tryGetTagNameFromUrl(url2, logger) {
|
||||
return void 0;
|
||||
}
|
||||
const match = matches[matches.length - 1];
|
||||
if (match === null || match.length !== 2) {
|
||||
if (match?.length !== 2) {
|
||||
logger.debug(
|
||||
`Could not determine tag name for URL ${url2}. Matched ${JSON.stringify(
|
||||
match
|
||||
|
||||
Generated
+4
-4
@@ -129872,13 +129872,13 @@ async function getTarVersion() {
|
||||
}
|
||||
if (stdout.includes("GNU tar")) {
|
||||
const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match[1] };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match[1] };
|
||||
@@ -130258,7 +130258,7 @@ function tryGetTagNameFromUrl(url2, logger) {
|
||||
return void 0;
|
||||
}
|
||||
const match = matches[matches.length - 1];
|
||||
if (match === null || match.length !== 2) {
|
||||
if (match?.length !== 2) {
|
||||
logger.debug(
|
||||
`Could not determine tag name for URL ${url2}. Matched ${JSON.stringify(
|
||||
match
|
||||
@@ -133655,7 +133655,7 @@ function getInputOrThrow(workflow, jobName, actionName, inputName, matrixVars) {
|
||||
input = input.replace(`\${{matrix.${key}}}`, value);
|
||||
}
|
||||
}
|
||||
if (input !== void 0 && input.includes("${{")) {
|
||||
if (input?.includes("${{")) {
|
||||
throw new Error(
|
||||
`Could not get ${inputName} input to ${actionName} since it contained an unrecognized dynamic value.`
|
||||
);
|
||||
|
||||
Generated
+5
-5
@@ -88036,7 +88036,7 @@ function parseQueriesFromInput(rawQueriesInput, queriesInputCombines, errorToThr
|
||||
}
|
||||
function combineQueries(logger, config, augmentationProperties) {
|
||||
const result = [];
|
||||
if (augmentationProperties.repoPropertyQueries && augmentationProperties.repoPropertyQueries.input) {
|
||||
if (augmentationProperties.repoPropertyQueries?.input) {
|
||||
logger.info(
|
||||
`Found query configuration in the repository properties (${"github-codeql-extra-queries" /* EXTRA_QUERIES */}): ${augmentationProperties.repoPropertyQueries.input.map((q) => q.uses).join(", ")}`
|
||||
);
|
||||
@@ -89584,7 +89584,7 @@ async function getRemoteConfig(logger, configFile, apiDetails, validateConfig) {
|
||||
"(?<owner>[^/]+)/(?<repo>[^/]+)/(?<path>[^@]+)@(?<ref>.*)"
|
||||
);
|
||||
const pieces = format.exec(configFile);
|
||||
if (pieces === null || pieces.groups === void 0 || pieces.length < 5) {
|
||||
if (pieces?.groups === void 0 || pieces.length < 5) {
|
||||
throw new ConfigurationError(
|
||||
getConfigFileRepoFormatInvalidMessage(configFile)
|
||||
);
|
||||
@@ -90194,13 +90194,13 @@ async function getTarVersion() {
|
||||
}
|
||||
if (stdout.includes("GNU tar")) {
|
||||
const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match[1] };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match[1] };
|
||||
@@ -90580,7 +90580,7 @@ function tryGetTagNameFromUrl(url, logger) {
|
||||
return void 0;
|
||||
}
|
||||
const match = matches[matches.length - 1];
|
||||
if (match === null || match.length !== 2) {
|
||||
if (match?.length !== 2) {
|
||||
logger.debug(
|
||||
`Could not determine tag name for URL ${url}. Matched ${JSON.stringify(
|
||||
match
|
||||
|
||||
Generated
+3
-3
@@ -87151,13 +87151,13 @@ async function getTarVersion() {
|
||||
}
|
||||
if (stdout.includes("GNU tar")) {
|
||||
const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match[1] };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match[1] };
|
||||
@@ -87537,7 +87537,7 @@ function tryGetTagNameFromUrl(url, logger) {
|
||||
return void 0;
|
||||
}
|
||||
const match = matches[matches.length - 1];
|
||||
if (match === null || match.length !== 2) {
|
||||
if (match?.length !== 2) {
|
||||
logger.debug(
|
||||
`Could not determine tag name for URL ${url}. Matched ${JSON.stringify(
|
||||
match
|
||||
|
||||
Generated
+1
-1
@@ -118975,7 +118975,7 @@ async function runWrapper() {
|
||||
getTemporaryDirectory(),
|
||||
logger
|
||||
);
|
||||
if (config && config.debugMode || core13.isDebug()) {
|
||||
if (config?.debugMode || core13.isDebug()) {
|
||||
const logFilePath = core13.getState("proxy-log-file");
|
||||
logger.info(
|
||||
"Debug mode is on. Uploading proxy log as Actions debugging artifact..."
|
||||
|
||||
Generated
+3
-3
@@ -89703,13 +89703,13 @@ async function getTarVersion() {
|
||||
}
|
||||
if (stdout.includes("GNU tar")) {
|
||||
const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match[1] };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match[1] };
|
||||
@@ -90089,7 +90089,7 @@ function tryGetTagNameFromUrl(url2, logger) {
|
||||
return void 0;
|
||||
}
|
||||
const match = matches[matches.length - 1];
|
||||
if (match === null || match.length !== 2) {
|
||||
if (match?.length !== 2) {
|
||||
logger.debug(
|
||||
`Could not determine tag name for URL ${url2}. Matched ${JSON.stringify(
|
||||
match
|
||||
|
||||
Generated
+3
-3
@@ -90376,13 +90376,13 @@ async function getTarVersion() {
|
||||
}
|
||||
if (stdout.includes("GNU tar")) {
|
||||
const match = stdout.match(/tar \(GNU tar\) ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "gnu", version: match[1] };
|
||||
} else if (stdout.includes("bsdtar")) {
|
||||
const match = stdout.match(/bsdtar ([0-9.]+)/);
|
||||
if (!match || !match[1]) {
|
||||
if (!match?.[1]) {
|
||||
throw new Error("Failed to parse output of tar --version.");
|
||||
}
|
||||
return { type: "bsd", version: match[1] };
|
||||
@@ -90762,7 +90762,7 @@ function tryGetTagNameFromUrl(url2, logger) {
|
||||
return void 0;
|
||||
}
|
||||
const match = matches[matches.length - 1];
|
||||
if (match === null || match.length !== 2) {
|
||||
if (match?.length !== 2) {
|
||||
logger.debug(
|
||||
`Could not determine tag name for URL ${url2}. Matched ${JSON.stringify(
|
||||
match
|
||||
|
||||
Reference in New Issue
Block a user