mirror of
https://github.com/gradle/actions.git
synced 2025-12-08 17:15:46 +08:00
Remove deprecated input parameters
This commit is contained in:
@@ -4,7 +4,6 @@ import * as cache from '@actions/cache'
|
||||
import * as deprecator from './deprecation-collector'
|
||||
import {SUMMARY_ENV_VAR} from '@actions/core/lib/summary'
|
||||
|
||||
import {parseArgsStringToArgv} from 'string-argv'
|
||||
import path from 'path'
|
||||
|
||||
const ACTION_ID_VAR = 'GRADLE_ACTION_ID'
|
||||
@@ -173,11 +172,6 @@ export class SummaryConfig {
|
||||
return false
|
||||
}
|
||||
|
||||
// Check if Job Summary is disabled using the deprecated input
|
||||
if (!this.isJobSummaryEnabled()) {
|
||||
return false
|
||||
}
|
||||
|
||||
return this.shouldAddJobSummary(this.getJobSummaryOption(), hasFailure)
|
||||
}
|
||||
|
||||
@@ -196,10 +190,6 @@ export class SummaryConfig {
|
||||
}
|
||||
}
|
||||
|
||||
private isJobSummaryEnabled(): boolean {
|
||||
return getBooleanInput('generate-job-summary', true)
|
||||
}
|
||||
|
||||
private getJobSummaryOption(): JobSummaryOption {
|
||||
return this.parseJobSummaryOption('add-job-summary')
|
||||
}
|
||||
@@ -239,11 +229,11 @@ export class BuildScanConfig {
|
||||
}
|
||||
|
||||
getBuildScanTermsOfUseUrl(): string {
|
||||
return this.getTermsOfUseProp('build-scan-terms-of-use-url', 'build-scan-terms-of-service-url')
|
||||
return core.getInput('build-scan-terms-of-use-url')
|
||||
}
|
||||
|
||||
getBuildScanTermsOfUseAgree(): string {
|
||||
return this.getTermsOfUseProp('build-scan-terms-of-use-agree', 'build-scan-terms-of-service-agree')
|
||||
return core.getInput('build-scan-terms-of-use-agree')
|
||||
}
|
||||
|
||||
getDevelocityAccessKey(): string {
|
||||
@@ -312,22 +302,6 @@ export class BuildScanConfig {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO @bigdaz: remove support for the deprecated input property in the next major release of the action
|
||||
*/
|
||||
private getTermsOfUseProp(newPropName: string, oldPropName: string): string {
|
||||
const newProp = core.getInput(newPropName)
|
||||
if (newProp !== '') {
|
||||
return newProp
|
||||
}
|
||||
const oldProp = core.getInput(oldPropName)
|
||||
if (oldProp !== '') {
|
||||
deprecator.recordDeprecation('The `build-scan-terms-of-service` input parameters have been renamed')
|
||||
return oldProp
|
||||
}
|
||||
return core.getInput(oldPropName)
|
||||
}
|
||||
}
|
||||
|
||||
export class GradleExecutionConfig {
|
||||
@@ -345,16 +319,6 @@ export class GradleExecutionConfig {
|
||||
return resolvedBuildRootDirectory
|
||||
}
|
||||
|
||||
getArguments(): string[] {
|
||||
const input = core.getInput('arguments')
|
||||
if (input.length !== 0) {
|
||||
deprecator.recordDeprecation(
|
||||
'Using the action to execute Gradle via the `arguments` parameter is deprecated'
|
||||
)
|
||||
}
|
||||
return parseArgsStringToArgv(input)
|
||||
}
|
||||
|
||||
getDependencyResolutionTask(): string {
|
||||
return core.getInput('dependency-resolution-task') || ':ForceDependencyResolutionPlugin_resolveAllDependencies'
|
||||
}
|
||||
@@ -362,6 +326,16 @@ export class GradleExecutionConfig {
|
||||
getAdditionalArguments(): string {
|
||||
return core.getInput('additional-arguments')
|
||||
}
|
||||
|
||||
verifyNoArguments(): void {
|
||||
const input = core.getInput('arguments')
|
||||
if (input.length !== 0) {
|
||||
deprecator.failOnUseOfRemovedFeature(
|
||||
`The 'arguments' parameter is no longer supported for ${getActionId()}`,
|
||||
'Using the action to execute Gradle via the `arguments` parameter is deprecated'
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function doValidateWrappers(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user