Recommend using default setup or matrixing languages

This commit is contained in:
Henry Mercer
2025-05-14 16:45:49 +01:00
parent 15bce5bb14
commit feafcfebbe
9 changed files with 44 additions and 3 deletions

13
lib/config-utils.js generated
View File

@@ -60,11 +60,14 @@ exports.parseBuildModeInput = parseBuildModeInput;
const fs = __importStar(require("fs"));
const path = __importStar(require("path"));
const perf_hooks_1 = require("perf_hooks");
const core = __importStar(require("@actions/core"));
const yaml = __importStar(require("js-yaml"));
const semver = __importStar(require("semver"));
const api = __importStar(require("./api-client"));
const caching_utils_1 = require("./caching-utils");
const diff_informed_analysis_utils_1 = require("./diff-informed-analysis-utils");
const doc_url_1 = require("./doc-url");
const environment_1 = require("./environment");
const feature_flags_1 = require("./feature-flags");
const languages_1 = require("./languages");
const trap_caching_1 = require("./trap-caching");
@@ -212,6 +215,16 @@ async function getRawLanguages(languagesInput, repository, logger) {
.split(",")
.map((x) => x.trim().toLowerCase())
.filter((x) => x.length > 0);
if (rawLanguages.length > 1 &&
process.env[environment_1.EnvVar.SUPPRESS_SINGLE_LANGUAGE_PER_JOB_RECOMMENDATION] !==
"true") {
core.notice("For the best experience, we recommend analyzing each language within its own Actions job. " +
"If you do not need a highly customizable code scanning configuration, consider using default setup for code scanning. " +
"Otherwise, consider using a matrix to analyze each language in its own job. " +
// Space before period to avoid issues copying links
`For more information, see ${doc_url_1.DocUrl.CONFIGURE_DEFAULT_SETUP} and ${doc_url_1.DocUrl.ACTIONS_MATRIX} . ` +
`To suppress this recommendation, set the environment variable ${environment_1.EnvVar.SUPPRESS_SINGLE_LANGUAGE_PER_JOB_RECOMMENDATION} to "true".`);
}
let autodetected;
if (rawLanguages.length) {
autodetected = false;