mirror of
https://github.com/gradle/actions.git
synced 2025-04-19 17:29:20 +08:00
Fail on delegation from legacy actions
This commit is contained in:
parent
ded8009fcf
commit
2041ce6ab1
@ -10,7 +10,7 @@ import {
|
||||
getActionId,
|
||||
setActionId
|
||||
} from '../../configuration'
|
||||
import {recordDeprecation, saveDeprecationState} from '../../deprecation-collector'
|
||||
import {failOnUseOfRemovedFeature, saveDeprecationState} from '../../deprecation-collector'
|
||||
import {handleMainActionError} from '../../errors'
|
||||
|
||||
/**
|
||||
@ -19,14 +19,13 @@ import {handleMainActionError} from '../../errors'
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
if (getActionId() === 'gradle/gradle-build-action') {
|
||||
|
||||
recordDeprecation(
|
||||
failOnUseOfRemovedFeature(
|
||||
'The action `gradle/gradle-build-action` has been replaced by `gradle/actions/setup-gradle`'
|
||||
)
|
||||
} else {
|
||||
setActionId('gradle/actions/setup-gradle')
|
||||
}
|
||||
|
||||
setActionId('gradle/actions/setup-gradle')
|
||||
|
||||
// Check for invalid wrapper JARs if requested
|
||||
if (doValidateWrappers()) {
|
||||
await setupGradle.checkNoInvalidWrapperJars()
|
||||
|
@ -3,19 +3,19 @@ import * as core from '@actions/core'
|
||||
|
||||
import * as validate from '../../wrapper-validation/validate'
|
||||
import {getActionId, setActionId} from '../../configuration'
|
||||
import {recordDeprecation, emitDeprecationWarnings} from '../../deprecation-collector'
|
||||
import {failOnUseOfRemovedFeature, emitDeprecationWarnings} from '../../deprecation-collector'
|
||||
import {handleMainActionError} from '../../errors'
|
||||
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
if (getActionId() === 'gradle/wrapper-validation-action') {
|
||||
recordDeprecation(
|
||||
failOnUseOfRemovedFeature(
|
||||
'The action `gradle/wrapper-validation-action` has been replaced by `gradle/actions/wrapper-validation`'
|
||||
)
|
||||
} else {
|
||||
setActionId('gradle/actions/wrapper-validation')
|
||||
}
|
||||
|
||||
setActionId('gradle/actions/wrapper-validation')
|
||||
|
||||
const result = await validate.findInvalidWrapperJars(
|
||||
path.resolve('.'),
|
||||
+core.getInput('min-wrapper-count'),
|
||||
|
@ -22,11 +22,9 @@ export function recordDeprecation(message: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function failOnUseOfRemovedFeature(removalMessage: string, deprecationMessage: string): void {
|
||||
export function failOnUseOfRemovedFeature(removalMessage: string, deprecationMessage: string = removalMessage): void {
|
||||
const deprecation = new Deprecation(deprecationMessage)
|
||||
core.error(
|
||||
`${removalMessage}. See ${deprecation.getDocumentationLink()}`
|
||||
)
|
||||
core.error(`${removalMessage}. See ${deprecation.getDocumentationLink()}`)
|
||||
}
|
||||
|
||||
export function getDeprecations(): Deprecation[] {
|
||||
|
Loading…
x
Reference in New Issue
Block a user