mirror of
https://github.com/github/codeql-action.git
synced 2026-04-27 01:08:46 +00:00
Initialise analysis kinds before starting status report
This commit is contained in:
Generated
+44
-33
@@ -86062,6 +86062,46 @@ function isAnalyzingPullRequest() {
|
||||
return getPullRequestBranches() !== void 0;
|
||||
}
|
||||
|
||||
// src/analyses.ts
|
||||
var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => {
|
||||
AnalysisKind2["CodeScanning"] = "code-scanning";
|
||||
AnalysisKind2["CodeQuality"] = "code-quality";
|
||||
return AnalysisKind2;
|
||||
})(AnalysisKind || {});
|
||||
var supportedAnalysisKinds = new Set(Object.values(AnalysisKind));
|
||||
async function parseAnalysisKinds(input) {
|
||||
const components = input.split(",");
|
||||
if (components.length < 1) {
|
||||
throw new ConfigurationError(
|
||||
"At least one analysis kind must be configured."
|
||||
);
|
||||
}
|
||||
for (const component of components) {
|
||||
if (!supportedAnalysisKinds.has(component)) {
|
||||
throw new ConfigurationError(`Unknown analysis kind: ${component}`);
|
||||
}
|
||||
}
|
||||
return Array.from(
|
||||
new Set(components.map((component) => component))
|
||||
);
|
||||
}
|
||||
async function initAnalysisKinds(logger) {
|
||||
const analysisKinds = await parseAnalysisKinds(
|
||||
getRequiredInput("analysis-kinds")
|
||||
);
|
||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||
if (qualityQueriesInput !== void 0) {
|
||||
logger.warning(
|
||||
"The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. Use the `analysis-kinds` input to configure different analysis kinds instead."
|
||||
);
|
||||
}
|
||||
if (!analysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) {
|
||||
analysisKinds.push("code-quality" /* CodeQuality */);
|
||||
}
|
||||
return analysisKinds;
|
||||
}
|
||||
var codeQualityQueries = ["code-quality"];
|
||||
|
||||
// src/api-client.ts
|
||||
var core5 = __toESM(require_core());
|
||||
var githubUtils = __toESM(require_utils4());
|
||||
@@ -86254,31 +86294,6 @@ var fs9 = __toESM(require("fs"));
|
||||
var path11 = __toESM(require("path"));
|
||||
var import_perf_hooks = require("perf_hooks");
|
||||
|
||||
// src/analyses.ts
|
||||
var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => {
|
||||
AnalysisKind2["CodeScanning"] = "code-scanning";
|
||||
AnalysisKind2["CodeQuality"] = "code-quality";
|
||||
return AnalysisKind2;
|
||||
})(AnalysisKind || {});
|
||||
var supportedAnalysisKinds = new Set(Object.values(AnalysisKind));
|
||||
async function parseAnalysisKinds(input) {
|
||||
const components = input.split(",");
|
||||
if (components.length < 1) {
|
||||
throw new ConfigurationError(
|
||||
"At least one analysis kind must be configured."
|
||||
);
|
||||
}
|
||||
for (const component of components) {
|
||||
if (!supportedAnalysisKinds.has(component)) {
|
||||
throw new ConfigurationError(`Unknown analysis kind: ${component}`);
|
||||
}
|
||||
}
|
||||
return Array.from(
|
||||
new Set(components.map((component) => component))
|
||||
);
|
||||
}
|
||||
var codeQualityQueries = ["code-quality"];
|
||||
|
||||
// src/config/db-config.ts
|
||||
var path7 = __toESM(require("path"));
|
||||
var semver2 = __toESM(require_semver2());
|
||||
@@ -87691,10 +87706,8 @@ async function getRawLanguages(languagesInput, repository, sourceRoot, logger) {
|
||||
};
|
||||
}
|
||||
async function initActionState({
|
||||
analysisKindsInput,
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
qualityQueriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
dbLocation,
|
||||
@@ -87710,12 +87723,9 @@ async function initActionState({
|
||||
githubVersion,
|
||||
features,
|
||||
repositoryProperties,
|
||||
analysisKinds,
|
||||
logger
|
||||
}, userConfig) {
|
||||
const analysisKinds = await parseAnalysisKinds(analysisKindsInput);
|
||||
if (!analysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) {
|
||||
analysisKinds.push("code-quality" /* CodeQuality */);
|
||||
}
|
||||
const languages = await getLanguages(
|
||||
codeql,
|
||||
languagesInput,
|
||||
@@ -90786,7 +90796,8 @@ async function run() {
|
||||
getOptionalInput("source-root") || ""
|
||||
);
|
||||
try {
|
||||
await sendStartingStatusReport(startedAt, config, logger);
|
||||
const analysisKinds = await initAnalysisKinds(logger);
|
||||
await sendStartingStatusReport(startedAt, { analysisKinds }, logger);
|
||||
const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(
|
||||
gitHubVersion.type
|
||||
);
|
||||
@@ -90840,7 +90851,7 @@ async function run() {
|
||||
);
|
||||
}
|
||||
config = await initConfig2({
|
||||
analysisKindsInput: getRequiredInput("analysis-kinds"),
|
||||
analysisKinds,
|
||||
languagesInput: getOptionalInput("languages"),
|
||||
queriesInput: getOptionalInput("queries"),
|
||||
qualityQueriesInput,
|
||||
|
||||
Reference in New Issue
Block a user