mirror of
https://github.com/github/codeql-action.git
synced 2026-05-21 07:10:07 +00:00
Enforce that only compatible kinds can be enabled concurrently
This commit is contained in:
Generated
+19
-3
@@ -103836,6 +103836,11 @@ var AnalysisKind = /* @__PURE__ */ ((AnalysisKind3) => {
|
||||
AnalysisKind3["CSRA"] = "csra";
|
||||
return AnalysisKind3;
|
||||
})(AnalysisKind || {});
|
||||
var compatibilityMatrix = {
|
||||
["code-scanning" /* CodeScanning */]: /* @__PURE__ */ new Set(["code-quality" /* CodeQuality */]),
|
||||
["code-quality" /* CodeQuality */]: /* @__PURE__ */ new Set(["code-scanning" /* CodeScanning */]),
|
||||
["csra" /* CSRA */]: /* @__PURE__ */ new Set()
|
||||
};
|
||||
var supportedAnalysisKinds = new Set(Object.values(AnalysisKind));
|
||||
async function parseAnalysisKinds(input) {
|
||||
const components = input.split(",");
|
||||
@@ -103858,7 +103863,7 @@ async function getAnalysisKinds(logger, skipCache = false) {
|
||||
if (!skipCache && cachedAnalysisKinds !== void 0) {
|
||||
return cachedAnalysisKinds;
|
||||
}
|
||||
cachedAnalysisKinds = await parseAnalysisKinds(
|
||||
const analysisKinds = await parseAnalysisKinds(
|
||||
getRequiredInput("analysis-kinds")
|
||||
);
|
||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||
@@ -103867,9 +103872,20 @@ async function getAnalysisKinds(logger, skipCache = false) {
|
||||
"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 (!cachedAnalysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) {
|
||||
cachedAnalysisKinds.push("code-quality" /* CodeQuality */);
|
||||
if (!analysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) {
|
||||
analysisKinds.push("code-quality" /* CodeQuality */);
|
||||
}
|
||||
for (const analysisKind of analysisKinds) {
|
||||
for (const otherAnalysisKind of analysisKinds) {
|
||||
if (analysisKind === otherAnalysisKind) continue;
|
||||
if (!compatibilityMatrix[analysisKind].has(otherAnalysisKind)) {
|
||||
throw new ConfigurationError(
|
||||
`${otherAnalysisKind} cannot be enabled at the same time as ${analysisKind}`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
cachedAnalysisKinds = analysisKinds;
|
||||
return cachedAnalysisKinds;
|
||||
}
|
||||
var codeQualityQueries = ["code-quality"];
|
||||
|
||||
Reference in New Issue
Block a user