mirror of
https://github.com/github/codeql-action.git
synced 2025-12-31 19:50:32 +08:00
Read and parse quality-queries input
This commit is contained in:
@@ -170,6 +170,11 @@ export interface AugmentationProperties {
|
||||
*/
|
||||
queriesInput?: Array<{ uses: string }>;
|
||||
|
||||
/**
|
||||
* The quality queries input from the `with` block of the action declaration.
|
||||
*/
|
||||
qualityQueriesInput?: Array<{ uses: string }>;
|
||||
|
||||
/**
|
||||
* Whether or not the packs input combines with the packs in the config.
|
||||
*/
|
||||
@@ -195,6 +200,7 @@ export const defaultAugmentationProperties: AugmentationProperties = {
|
||||
packsInputCombines: false,
|
||||
packsInput: undefined,
|
||||
queriesInput: undefined,
|
||||
qualityQueriesInput: undefined,
|
||||
defaultQueryFilters: [],
|
||||
};
|
||||
export type Packs = Partial<Record<Language, string[]>>;
|
||||
@@ -405,6 +411,7 @@ export async function getRawLanguages(
|
||||
export interface InitConfigInputs {
|
||||
languagesInput: string | undefined;
|
||||
queriesInput: string | undefined;
|
||||
qualityQueriesInput: string | undefined;
|
||||
packsInput: string | undefined;
|
||||
configFile: string | undefined;
|
||||
dbLocation: string | undefined;
|
||||
@@ -440,6 +447,7 @@ type LoadConfigInputs = Omit<InitConfigInputs, "configInput"> & {
|
||||
export async function getDefaultConfig({
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
qualityQueriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
dbLocation,
|
||||
@@ -474,6 +482,7 @@ export async function getDefaultConfig({
|
||||
features,
|
||||
packsInput,
|
||||
queriesInput,
|
||||
qualityQueriesInput,
|
||||
languages,
|
||||
logger,
|
||||
);
|
||||
@@ -528,6 +537,7 @@ async function downloadCacheWithTime(
|
||||
async function loadConfig({
|
||||
languagesInput,
|
||||
queriesInput,
|
||||
qualityQueriesInput,
|
||||
packsInput,
|
||||
buildModeInput,
|
||||
configFile,
|
||||
@@ -583,6 +593,7 @@ async function loadConfig({
|
||||
features,
|
||||
packsInput,
|
||||
queriesInput,
|
||||
qualityQueriesInput,
|
||||
languages,
|
||||
logger,
|
||||
);
|
||||
@@ -639,6 +650,7 @@ export async function calculateAugmentation(
|
||||
features: FeatureEnablement,
|
||||
rawPacksInput: string | undefined,
|
||||
rawQueriesInput: string | undefined,
|
||||
rawQualityQueriesInput: string | undefined,
|
||||
languages: Language[],
|
||||
logger: Logger,
|
||||
): Promise<AugmentationProperties> {
|
||||
@@ -654,6 +666,11 @@ export async function calculateAugmentation(
|
||||
queriesInputCombines,
|
||||
);
|
||||
|
||||
const qualityQueriesInput = parseQueriesFromInput(
|
||||
rawQualityQueriesInput,
|
||||
false,
|
||||
);
|
||||
|
||||
const defaultQueryFilters: QueryFilter[] = [];
|
||||
if (await shouldPerformDiffInformedAnalysis(codeql, features, logger)) {
|
||||
defaultQueryFilters.push({ exclude: { tags: "exclude-from-incremental" } });
|
||||
@@ -664,6 +681,7 @@ export async function calculateAugmentation(
|
||||
packsInput: packsInput?.[languages[0]],
|
||||
queriesInput,
|
||||
queriesInputCombines,
|
||||
qualityQueriesInput,
|
||||
defaultQueryFilters,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user