SQSCANGHA-112 Migrate installation step
This commit is contained in:
committed by
Julien HENRY
parent
8f448484d9
commit
ed9f3aad50
2727
dist/index.js
vendored
2727
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
47
dist/sanity-checks.js
vendored
47
dist/sanity-checks.js
vendored
@@ -1,47 +0,0 @@
|
||||
import fs from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
function validateScannerVersion(version) {
|
||||
if (!version) {
|
||||
return;
|
||||
}
|
||||
|
||||
const versionRegex = /^\d+\.\d+\.\d+\.\d+$/;
|
||||
if (!versionRegex.test(version)) {
|
||||
throw new Error(
|
||||
"Invalid scannerVersion format. Expected format: x.y.z.w (e.g., 7.1.0.4889)"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function checkSonarToken(core) {
|
||||
if (!process.env.SONAR_TOKEN) {
|
||||
core.warning(
|
||||
"Running this GitHub Action without SONAR_TOKEN is not recommended"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function checkMavenProject(core, projectBaseDir) {
|
||||
const pomPath = join(projectBaseDir.replace(/\/$/, ""), "pom.xml");
|
||||
if (fs.existsSync(pomPath)) {
|
||||
core.warning(
|
||||
"Maven project detected. Sonar recommends running the 'org.sonarsource.scanner.maven:sonar-maven-plugin:sonar' goal during the build process instead of using this GitHub Action to get more accurate results."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function checkGradleProject(core, projectBaseDir) {
|
||||
const baseDir = projectBaseDir.replace(/\/$/, "");
|
||||
const gradlePath = join(baseDir, "build.gradle");
|
||||
const gradleKtsPath = join(baseDir, "build.gradle.kts");
|
||||
|
||||
if (fs.existsSync(gradlePath) || fs.existsSync(gradleKtsPath)) {
|
||||
core.warning(
|
||||
"Gradle project detected. Sonar recommends using the SonarQube plugin for Gradle during the build process instead of using this GitHub Action to get more accurate results."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export { checkGradleProject, checkMavenProject, checkSonarToken, validateScannerVersion };
|
||||
//# sourceMappingURL=sanity-checks.js.map
|
||||
1
dist/sanity-checks.js.map
vendored
1
dist/sanity-checks.js.map
vendored
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"sanity-checks.js","sources":["../src/sanity-checks.js"],"sourcesContent":["import fs from \"fs\";\nimport { join } from \"path\";\n\nexport function validateScannerVersion(version) {\n if (!version) {\n return;\n }\n\n const versionRegex = /^\\d+\\.\\d+\\.\\d+\\.\\d+$/;\n if (!versionRegex.test(version)) {\n throw new Error(\n \"Invalid scannerVersion format. Expected format: x.y.z.w (e.g., 7.1.0.4889)\"\n );\n }\n}\n\nexport function checkSonarToken(core) {\n if (!process.env.SONAR_TOKEN) {\n core.warning(\n \"Running this GitHub Action without SONAR_TOKEN is not recommended\"\n );\n }\n}\n\nexport function checkMavenProject(core, projectBaseDir) {\n const pomPath = join(projectBaseDir.replace(/\\/$/, \"\"), \"pom.xml\");\n if (fs.existsSync(pomPath)) {\n core.warning(\n \"Maven project detected. Sonar recommends running the 'org.sonarsource.scanner.maven:sonar-maven-plugin:sonar' goal during the build process instead of using this GitHub Action to get more accurate results.\"\n );\n }\n}\n\nexport function checkGradleProject(core, projectBaseDir) {\n const baseDir = projectBaseDir.replace(/\\/$/, \"\");\n const gradlePath = join(baseDir, \"build.gradle\");\n const gradleKtsPath = join(baseDir, \"build.gradle.kts\");\n\n if (fs.existsSync(gradlePath) || fs.existsSync(gradleKtsPath)) {\n core.warning(\n \"Gradle project detected. Sonar recommends using the SonarQube plugin for Gradle during the build process instead of using this GitHub Action to get more accurate results.\"\n );\n }\n}\n"],"names":[],"mappings":";;;AAGO,SAAS,sBAAsB,CAAC,OAAO,EAAE;AAChD,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,YAAY,GAAG,sBAAsB;AAC7C,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC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