mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Log error for non-default analysis-kinds input outside of managed workflows
This commit is contained in:
18
lib/init-action.js
generated
18
lib/init-action.js
generated
@@ -87589,6 +87589,12 @@ async function parseAnalysisKinds(input) {
|
||||
);
|
||||
}
|
||||
var cachedAnalysisKinds;
|
||||
function isOnlyCodeScanningEnabled(analysisKinds) {
|
||||
return analysisKinds.length === 1 && analysisKinds[0] === "code-scanning" /* CodeScanning */;
|
||||
}
|
||||
function makeAnalysisKindUsageError(message) {
|
||||
return `The \`analysis-kinds\` input is experimental and for GitHub-internal use only. Its behaviour may change at any time or be removed entirely. ${message}`;
|
||||
}
|
||||
async function getAnalysisKinds(logger, features, skipCache = false) {
|
||||
if (!skipCache && cachedAnalysisKinds !== void 0) {
|
||||
return cachedAnalysisKinds;
|
||||
@@ -87596,6 +87602,14 @@ async function getAnalysisKinds(logger, features, skipCache = false) {
|
||||
const analysisKinds = await parseAnalysisKinds(
|
||||
getRequiredInput("analysis-kinds")
|
||||
);
|
||||
if (!isInTestMode() && !isDynamicWorkflow() && !isOnlyCodeScanningEnabled(analysisKinds)) {
|
||||
const codeQualityHint = analysisKinds.includes("code-quality" /* CodeQuality */) ? " If your intention is to use quality queries outside of Code Quality, use the `queries` input with `code-quality` instead." : "";
|
||||
logger.error(
|
||||
makeAnalysisKindUsageError(
|
||||
`An analysis kind other than \`code-scanning\` was specified in a custom workflow. This is not supported and will become a fatal error in a future version of the CodeQL Action.${codeQualityHint}`
|
||||
)
|
||||
);
|
||||
}
|
||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||
if (qualityQueriesInput !== void 0) {
|
||||
logger.warning(
|
||||
@@ -87617,7 +87631,9 @@ async function getAnalysisKinds(logger, features, skipCache = false) {
|
||||
}
|
||||
if (!isInTestMode() && analysisKinds.length > 1 && !await features.getValue("allow_multiple_analysis_kinds" /* AllowMultipleAnalysisKinds */)) {
|
||||
logger.error(
|
||||
"The `analysis-kinds` input is experimental and for GitHub-internal use only. Its behaviour may change at any time or be removed entirely. Specifying multiple values as input is no longer supported. Continuing with only `analysis-kinds: code-scanning`."
|
||||
makeAnalysisKindUsageError(
|
||||
"Specifying multiple values as input is no longer supported. Continuing with only `analysis-kinds: code-scanning`."
|
||||
)
|
||||
);
|
||||
cachedAnalysisKinds = ["code-scanning" /* CodeScanning */];
|
||||
return cachedAnalysisKinds;
|
||||
|
||||
18
lib/setup-codeql-action.js
generated
18
lib/setup-codeql-action.js
generated
@@ -87029,6 +87029,12 @@ async function parseAnalysisKinds(input) {
|
||||
);
|
||||
}
|
||||
var cachedAnalysisKinds;
|
||||
function isOnlyCodeScanningEnabled(analysisKinds) {
|
||||
return analysisKinds.length === 1 && analysisKinds[0] === "code-scanning" /* CodeScanning */;
|
||||
}
|
||||
function makeAnalysisKindUsageError(message) {
|
||||
return `The \`analysis-kinds\` input is experimental and for GitHub-internal use only. Its behaviour may change at any time or be removed entirely. ${message}`;
|
||||
}
|
||||
async function getAnalysisKinds(logger, features, skipCache = false) {
|
||||
if (!skipCache && cachedAnalysisKinds !== void 0) {
|
||||
return cachedAnalysisKinds;
|
||||
@@ -87036,6 +87042,14 @@ async function getAnalysisKinds(logger, features, skipCache = false) {
|
||||
const analysisKinds = await parseAnalysisKinds(
|
||||
getRequiredInput("analysis-kinds")
|
||||
);
|
||||
if (!isInTestMode() && !isDynamicWorkflow() && !isOnlyCodeScanningEnabled(analysisKinds)) {
|
||||
const codeQualityHint = analysisKinds.includes("code-quality" /* CodeQuality */) ? " If your intention is to use quality queries outside of Code Quality, use the `queries` input with `code-quality` instead." : "";
|
||||
logger.error(
|
||||
makeAnalysisKindUsageError(
|
||||
`An analysis kind other than \`code-scanning\` was specified in a custom workflow. This is not supported and will become a fatal error in a future version of the CodeQL Action.${codeQualityHint}`
|
||||
)
|
||||
);
|
||||
}
|
||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||
if (qualityQueriesInput !== void 0) {
|
||||
logger.warning(
|
||||
@@ -87057,7 +87071,9 @@ async function getAnalysisKinds(logger, features, skipCache = false) {
|
||||
}
|
||||
if (!isInTestMode() && analysisKinds.length > 1 && !await features.getValue("allow_multiple_analysis_kinds" /* AllowMultipleAnalysisKinds */)) {
|
||||
logger.error(
|
||||
"The `analysis-kinds` input is experimental and for GitHub-internal use only. Its behaviour may change at any time or be removed entirely. Specifying multiple values as input is no longer supported. Continuing with only `analysis-kinds: code-scanning`."
|
||||
makeAnalysisKindUsageError(
|
||||
"Specifying multiple values as input is no longer supported. Continuing with only `analysis-kinds: code-scanning`."
|
||||
)
|
||||
);
|
||||
cachedAnalysisKinds = ["code-scanning" /* CodeScanning */];
|
||||
return cachedAnalysisKinds;
|
||||
|
||||
Reference in New Issue
Block a user