From cc65887c5cf734590c1b2a521b932dc7867c8cdb Mon Sep 17 00:00:00 2001 From: tiulpin Date: Thu, 30 Jun 2022 20:13:44 +0200 Subject: [PATCH] :fire: Remove deprecated action parameters --- action.yaml | 60 +---------------------------------- scan/dist/index.js | 68 +-------------------------------------- scan/src/utils.ts | 79 +++------------------------------------------- 3 files changed, 6 insertions(+), 201 deletions(-) diff --git a/action.yaml b/action.yaml index eff90564..a423d719 100644 --- a/action.yaml +++ b/action.yaml @@ -26,7 +26,7 @@ inputs: required: false default: "${{ github.sha }}" upload-result: - description: 'Upload Qodana results as an artifact to the job' + description: 'Upload Qodana results on GitHub as an artifact to the job' required: false default: "true" artifact-name: @@ -41,64 +41,6 @@ inputs: description: 'GitHub token to be used for uploading annotations' required: false default: ${{ github.token }} - linter: - description: '[DEPRECATED] Qodana linter – [official Qodana Docker image](#supported-qodana-docker-images).' - required: false - deprecationMessage: 'Use `args` (e.g. `args: --linter,`) instead' - project-dir: - description: '[DEPRECATED] Root directory of the project to be analyzed' - required: false - deprecationMessage: 'Use `args` (e.g. `args: --project-dir,`) instead' - idea-config-dir: - description: '[DEPRECATED] IntelliJ IDEA configuration directory' - required: false - deprecationMessage: 'Use `args` to mount the directory (e.g. `args: -v,:/root/.config/idea`) instead' - gradle-settings-path: - description: '[DEPRECATED] Provide path to gradle.properties file. An example: "/your/custom/path/gradle.properties"' - required: false - deprecationMessage: 'Use `args` to mount the file (e.g. `args: -v,:/root/.gradle/gradle.properties`) instead' - additional-volumes: - description: '[DEPRECATED] Mount additional volumes to Docker container' - required: false - deprecationMessage: 'Use `args` to mount any directory (e.g. `args: -v,:,-v,:`) instead' - additional-env-variables: - description: '[DEPRECATED] Pass additional environment variables to docker container' - required: false - deprecationMessage: 'Use `args` to pass any environment variable (e.g. `args: -e,=,-e,=`) instead' - fail-threshold: - description: '[DEPRECATED] Set the number of problems that will serve as a quality gate. If this number is reached, the pipeline run is terminated' - required: false - deprecationMessage: 'Use `args` to pass the threshold (e.g. `args: --fail-threshold,`) instead' - inspected-dir: - description: '[DEPRECATED] Directory to be inspected. If not specified, the whole project is inspected by default' - required: false - deprecationMessage: 'Use `args` to pass the directory (e.g. `args: -d,`) instead' - baseline-path: - description: '[DEPRECATED] Run in baseline mode. Provide the path to an existing SARIF report to be used in the baseline state calculation' - required: false - deprecationMessage: 'Use `args` to pass the baseline path (e.g. `args: -b,`) instead' - baseline-include-absent: - description: '[DEPRECATED] Include the results from the baseline absent in the current Qodana run in the output report' - required: false - default: "false" - deprecationMessage: 'Use `args` to pass the baseline include absent flag (e.g. `args: --baseline-include-absent`) instead' - changes: - description: '[DEPRECATED] Inspect uncommitted changes and report new problems' - required: false - default: "false" - deprecationMessage: 'Use `args` to pass the changes flag (e.g. `args: --changes`) instead' - script: - description: '[DEPRECATED] Override the default docker scenario' - required: false - deprecationMessage: 'Use `args` to pass the script (e.g. `args: --script,`) instead' - profile-name: - description: '[DEPRECATED] Name of a profile defined in the project' - required: false - deprecationMessage: 'Use `args` to pass the profile name (e.g. `args: --profile-name,`) instead' - profile-path: - description: '[DEPRECATED] Absolute path to the profile file' - required: false - deprecationMessage: 'Use `args` to pass the profile path (e.g. `args: --profile-path,`) instead' runs: using: 'node12' diff --git a/scan/dist/index.js b/scan/dist/index.js index 2265298b..36c17898 100644 --- a/scan/dist/index.js +++ b/scan/dist/index.js @@ -68088,75 +68088,9 @@ var require_utils5 = __commonJS({ var tc = __importStar2(require_tool_cache()); var qodana_12 = (init_qodana(), __toCommonJS(qodana_exports)); var path_1 = __importDefault(require("path")); - function getDeprecatedInputs(args) { - const deprecatedInputs = { - linter: core2.getInput("linter"), - projectDir: core2.getInput("project-dir"), - additionalVolumes: core2.getMultilineInput("additional-volumes"), - additionalEnvVars: core2.getMultilineInput("additional-env-variables"), - inspectedDir: core2.getInput("inspected-dir"), - ideaConfigDir: core2.getInput("idea-config-dir"), - baselinePath: core2.getInput("baseline-path"), - baselineIncludeAbsent: core2.getBooleanInput("baseline-include-absent"), - failThreshold: core2.getInput("fail-threshold"), - profileName: core2.getInput("profile-name"), - profilePath: core2.getInput("profile-path"), - gradleSettingsPath: core2.getInput("gradle-settings-path"), - changes: core2.getBooleanInput("changes"), - script: core2.getInput("script") - }; - if (deprecatedInputs.linter) { - args.push("-l", deprecatedInputs.linter); - } - if (deprecatedInputs.projectDir) { - args.push("-i", deprecatedInputs.projectDir); - } - if (deprecatedInputs.additionalVolumes) { - for (const volume of deprecatedInputs.additionalVolumes) { - args.push("-v", volume); - } - } - if (deprecatedInputs.additionalEnvVars) { - for (const envVar of deprecatedInputs.additionalEnvVars) { - args.push("-e", envVar); - } - } - if (deprecatedInputs.inspectedDir) { - args.push("-d", deprecatedInputs.inspectedDir); - } - if (deprecatedInputs.ideaConfigDir) { - args.push("-v", `${deprecatedInputs.ideaConfigDir}:/root/.config/idea`); - } - if (deprecatedInputs.baselinePath) { - args.push("-b", deprecatedInputs.baselinePath); - } - if (deprecatedInputs.baselineIncludeAbsent) { - args.push("--baseline-include-absent"); - } - if (deprecatedInputs.failThreshold) { - args.push("--fail-threshold", deprecatedInputs.failThreshold); - } - if (deprecatedInputs.profileName) { - args.push("--profile-name", deprecatedInputs.profileName); - } - if (deprecatedInputs.profilePath) { - args.push("--profile-path", deprecatedInputs.profilePath); - } - if (deprecatedInputs.gradleSettingsPath) { - args.push("-v", `${deprecatedInputs.gradleSettingsPath}:/root/.gradle/gradle.properties`); - } - if (deprecatedInputs.changes) { - args.push("--changes"); - } - if (deprecatedInputs.script) { - args.push("--script", deprecatedInputs.script); - } - return args; - } - __name(getDeprecatedInputs, "getDeprecatedInputs"); function getInputs() { return { - args: getDeprecatedInputs(core2.getInput("args").split(",").map((arg) => arg.trim())), + args: core2.getInput("args").split(",").map((arg) => arg.trim()), resultsDir: core2.getInput("results-dir"), cacheDir: core2.getInput("cache-dir"), additionalCacheHash: core2.getInput("additional-cache-hash"), diff --git a/scan/src/utils.ts b/scan/src/utils.ts index 68c40fa2..794562ef 100644 --- a/scan/src/utils.ts +++ b/scan/src/utils.ts @@ -14,87 +14,16 @@ import { } from '../../common/qodana' import path from 'path' -function getDeprecatedInputs(args: string[]): string[] { - const deprecatedInputs = { - linter: core.getInput('linter'), - projectDir: core.getInput('project-dir'), - additionalVolumes: core.getMultilineInput('additional-volumes'), - additionalEnvVars: core.getMultilineInput('additional-env-variables'), - inspectedDir: core.getInput('inspected-dir'), - ideaConfigDir: core.getInput('idea-config-dir'), - baselinePath: core.getInput('baseline-path'), - baselineIncludeAbsent: core.getBooleanInput('baseline-include-absent'), - failThreshold: core.getInput('fail-threshold'), - profileName: core.getInput('profile-name'), - profilePath: core.getInput('profile-path'), - gradleSettingsPath: core.getInput('gradle-settings-path'), - changes: core.getBooleanInput('changes'), - script: core.getInput('script') - } - if (deprecatedInputs.linter) { - args.push('-l', deprecatedInputs.linter) - } - if (deprecatedInputs.projectDir) { - args.push('-i', deprecatedInputs.projectDir) - } - if (deprecatedInputs.additionalVolumes) { - for (const volume of deprecatedInputs.additionalVolumes) { - args.push('-v', volume) - } - } - if (deprecatedInputs.additionalEnvVars) { - for (const envVar of deprecatedInputs.additionalEnvVars) { - args.push('-e', envVar) - } - } - if (deprecatedInputs.inspectedDir) { - args.push('-d', deprecatedInputs.inspectedDir) - } - if (deprecatedInputs.ideaConfigDir) { - args.push('-v', `${deprecatedInputs.ideaConfigDir}:/root/.config/idea`) - } - if (deprecatedInputs.baselinePath) { - args.push('-b', deprecatedInputs.baselinePath) - } - if (deprecatedInputs.baselineIncludeAbsent) { - args.push('--baseline-include-absent') - } - if (deprecatedInputs.failThreshold) { - args.push('--fail-threshold', deprecatedInputs.failThreshold) - } - if (deprecatedInputs.profileName) { - args.push('--profile-name', deprecatedInputs.profileName) - } - if (deprecatedInputs.profilePath) { - args.push('--profile-path', deprecatedInputs.profilePath) - } - if (deprecatedInputs.gradleSettingsPath) { - args.push( - '-v', - `${deprecatedInputs.gradleSettingsPath}:/root/.gradle/gradle.properties` - ) - } - if (deprecatedInputs.changes) { - args.push('--changes') - } - if (deprecatedInputs.script) { - args.push('--script', deprecatedInputs.script) - } - return args -} - /** * The context for the action. * @returns The action inputs. */ export function getInputs(): Inputs { return { - args: getDeprecatedInputs( - core - .getInput('args') - .split(',') - .map(arg => arg.trim()) - ), + args: core + .getInput('args') + .split(',') + .map(arg => arg.trim()), resultsDir: core.getInput('results-dir'), cacheDir: core.getInput('cache-dir'), additionalCacheHash: core.getInput('additional-cache-hash'),