mirror of
https://github.com/github/codeql-action.git
synced 2026-05-31 10:54:40 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dbec30d40b | |||
| cafc096a47 |
+1
-1
@@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th
|
|||||||
|
|
||||||
## [UNRELEASED]
|
## [UNRELEASED]
|
||||||
|
|
||||||
No user facing changes.
|
- The experimental `quality-queries` input that was deprecated in CodeQL Action 3.30.2 has now been removed.
|
||||||
|
|
||||||
## 4.32.1 - 02 Feb 2026
|
## 4.32.1 - 02 Feb 2026
|
||||||
|
|
||||||
|
|||||||
@@ -99,9 +99,6 @@ inputs:
|
|||||||
queries:
|
queries:
|
||||||
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
|
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
|
||||||
required: false
|
required: false
|
||||||
quality-queries:
|
|
||||||
description: '[Internal] DEPRECATED. Comma-separated list of code quality queries to run.'
|
|
||||||
required: false
|
|
||||||
packs:
|
packs:
|
||||||
description: >-
|
description: >-
|
||||||
Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not
|
Comma-separated list of packs to run. Reference a pack in the format `scope/name[@version]`. If `version` is not
|
||||||
|
|||||||
Generated
+3
-6
@@ -102359,7 +102359,7 @@ async function parseAnalysisKinds(input) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
var cachedAnalysisKinds;
|
var cachedAnalysisKinds;
|
||||||
async function getAnalysisKinds(logger, skipCache = false) {
|
async function getAnalysisKinds(_logger, skipCache = false) {
|
||||||
if (!skipCache && cachedAnalysisKinds !== void 0) {
|
if (!skipCache && cachedAnalysisKinds !== void 0) {
|
||||||
return cachedAnalysisKinds;
|
return cachedAnalysisKinds;
|
||||||
}
|
}
|
||||||
@@ -102368,13 +102368,10 @@ async function getAnalysisKinds(logger, skipCache = false) {
|
|||||||
);
|
);
|
||||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||||
if (qualityQueriesInput !== void 0) {
|
if (qualityQueriesInput !== void 0) {
|
||||||
logger.warning(
|
throw new ConfigurationError(
|
||||||
"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."
|
"The `quality-queries` input is no longer supported. Use `analysis-kinds` instead."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!cachedAnalysisKinds.includes("code-quality" /* CodeQuality */) && qualityQueriesInput !== void 0) {
|
|
||||||
cachedAnalysisKinds.push("code-quality" /* CodeQuality */);
|
|
||||||
}
|
|
||||||
return cachedAnalysisKinds;
|
return cachedAnalysisKinds;
|
||||||
}
|
}
|
||||||
var codeQualityQueries = ["code-quality"];
|
var codeQualityQueries = ["code-quality"];
|
||||||
|
|||||||
@@ -52,14 +52,15 @@ test("getAnalysisKinds - returns expected analysis kinds for `analysis-kinds` in
|
|||||||
t.assert(result.includes(AnalysisKind.CodeQuality));
|
t.assert(result.includes(AnalysisKind.CodeQuality));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getAnalysisKinds - includes `code-quality` when deprecated `quality-queries` input is used", async (t) => {
|
test("getAnalysisKinds - throws ConfigurationError when deprecated `quality-queries` input is used", async (t) => {
|
||||||
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
|
const requiredInputStub = sinon.stub(actionsUtil, "getRequiredInput");
|
||||||
requiredInputStub.withArgs("analysis-kinds").returns("code-scanning");
|
requiredInputStub.withArgs("analysis-kinds").returns("code-scanning");
|
||||||
const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput");
|
||||||
optionalInputStub.withArgs("quality-queries").returns("code-quality");
|
optionalInputStub.withArgs("quality-queries").returns("code-quality");
|
||||||
const result = await getAnalysisKinds(getRunnerLogger(true), true);
|
|
||||||
t.assert(result.includes(AnalysisKind.CodeScanning));
|
await t.throwsAsync(getAnalysisKinds(getRunnerLogger(true), true), {
|
||||||
t.assert(result.includes(AnalysisKind.CodeQuality));
|
instanceOf: ConfigurationError,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("getAnalysisKinds - throws if `analysis-kinds` input is invalid", async (t) => {
|
test("getAnalysisKinds - throws if `analysis-kinds` input is invalid", async (t) => {
|
||||||
|
|||||||
+5
-17
@@ -50,17 +50,16 @@ let cachedAnalysisKinds: AnalysisKind[] | undefined;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialises the analysis kinds for the analysis based on the `analysis-kinds` input.
|
* Initialises the analysis kinds for the analysis based on the `analysis-kinds` input.
|
||||||
* This function will also use the deprecated `quality-queries` input as an indicator to enable `code-quality`.
|
|
||||||
* If the `analysis-kinds` input cannot be parsed, a `ConfigurationError` is thrown.
|
* If the `analysis-kinds` input cannot be parsed, a `ConfigurationError` is thrown.
|
||||||
*
|
*
|
||||||
* @param logger The logger to use.
|
* @param _logger The logger to use.
|
||||||
* @param skipCache For testing, whether to ignore the cached values (default: false).
|
* @param skipCache For testing, whether to ignore the cached values (default: false).
|
||||||
*
|
*
|
||||||
* @returns The array of enabled analysis kinds.
|
* @returns The array of enabled analysis kinds.
|
||||||
* @throws A `ConfigurationError` if the `analysis-kinds` input cannot be parsed.
|
* @throws A `ConfigurationError` if the `analysis-kinds` input cannot be parsed.
|
||||||
*/
|
*/
|
||||||
export async function getAnalysisKinds(
|
export async function getAnalysisKinds(
|
||||||
logger: Logger,
|
_logger: Logger,
|
||||||
skipCache: boolean = false,
|
skipCache: boolean = false,
|
||||||
): Promise<AnalysisKind[]> {
|
): Promise<AnalysisKind[]> {
|
||||||
if (!skipCache && cachedAnalysisKinds !== undefined) {
|
if (!skipCache && cachedAnalysisKinds !== undefined) {
|
||||||
@@ -71,26 +70,15 @@ export async function getAnalysisKinds(
|
|||||||
getRequiredInput("analysis-kinds"),
|
getRequiredInput("analysis-kinds"),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Warn that `quality-queries` is deprecated if there is an argument for it.
|
// Throw if there is an argument for `quality-queries`.
|
||||||
const qualityQueriesInput = getOptionalInput("quality-queries");
|
const qualityQueriesInput = getOptionalInput("quality-queries");
|
||||||
|
|
||||||
if (qualityQueriesInput !== undefined) {
|
if (qualityQueriesInput !== undefined) {
|
||||||
logger.warning(
|
throw new ConfigurationError(
|
||||||
"The `quality-queries` input is deprecated and will be removed in a future version of the CodeQL Action. " +
|
"The `quality-queries` input is no longer supported. Use `analysis-kinds` instead.",
|
||||||
"Use the `analysis-kinds` input to configure different analysis kinds instead.",
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For backwards compatibility, add Code Quality to the enabled analysis kinds
|
|
||||||
// if an input to `quality-queries` was specified. We should remove this once
|
|
||||||
// `quality-queries` is no longer used.
|
|
||||||
if (
|
|
||||||
!cachedAnalysisKinds.includes(AnalysisKind.CodeQuality) &&
|
|
||||||
qualityQueriesInput !== undefined
|
|
||||||
) {
|
|
||||||
cachedAnalysisKinds.push(AnalysisKind.CodeQuality);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cachedAnalysisKinds;
|
return cachedAnalysisKinds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user