diff --git a/docs/deprecation-upgrade-guide.md b/docs/deprecation-upgrade-guide.md index da913ff..d2d66cb 100644 --- a/docs/deprecation-upgrade-guide.md +++ b/docs/deprecation-upgrade-guide.md @@ -23,6 +23,26 @@ with uses: gradle/actions/setup-gradle@v3 ``` +## The action `gradle/wrapper-validation-action` has been replaced by `gradle/actions/wrapper-validation` + +To facilitate ongoing development, the `wrapper-validation-action` action implementation has been merged into +the https://github.com/gradle/actions repository, and the `gradle/wrapper-validation-action` has been replaced by the `gradle/actions/wrapper-validation` action. + +As of `v3.x`, the `gradle/wrapper-validation-action` and `gradle/actions/wrappper-validation` actions are +functionally identical, and are released with the same versions. + +In a future major version (likely `v4.x`) we will stop releasing new versions of `gradle/wrapper-validation-action`: +development and releases will continue in the `gradle/actions/wrapper-validation` action. + +To convert your workflows, simply replace: +``` + uses: gradle/wrapper-validation-action@v3 +``` +with +``` + uses: gradle/actions/wrapper-validation@v3 +``` + ## Using the action to execute Gradle via the `arguments` parameter is deprecated The core functionality of the `setup-gradle` (and `gradle-build-action`) actions is to configure your diff --git a/sources/src/deprecation-collector.ts b/sources/src/deprecation-collector.ts index a54a51d..3cfeffc 100644 --- a/sources/src/deprecation-collector.ts +++ b/sources/src/deprecation-collector.ts @@ -26,10 +26,10 @@ export function getDeprecations(): Deprecation[] { return recordedDeprecations } -export function emitDeprecationWarnings(): void { +export function emitDeprecationWarnings(hasJobSummary = true): void { if (recordedDeprecations.length > 0) { core.warning( - `This job uses deprecated functionality from the '${getActionId()}' action. Consult the Job Summary for more details.` + `This job uses deprecated functionality from the '${getActionId()}' action. Consult the ${hasJobSummary ? 'Job Summary' : 'logs'} for more details.` ) for (const deprecation of recordedDeprecations) { core.info(`DEPRECATION: ${deprecation.message}. See ${deprecation.getDocumentationLink()}`) diff --git a/sources/src/wrapper-validation/main.ts b/sources/src/wrapper-validation/main.ts index 34b1387..52b6d4f 100644 --- a/sources/src/wrapper-validation/main.ts +++ b/sources/src/wrapper-validation/main.ts @@ -2,10 +2,20 @@ import * as path from 'path' import * as core from '@actions/core' import * as validate from './validate' +import {getActionId, setActionId} from '../configuration' +import {recordDeprecation, emitDeprecationWarnings} from '../deprecation-collector' import {handleMainActionError} from '../errors' export async function run(): Promise { try { + if (getActionId() === 'gradle/wrapper-validation-action') { + recordDeprecation( + 'The action `gradle/wrapper-validation-action` has been replaced by `gradle/actions/wrapper-validation`' + ) + } else { + setActionId('gradle/actions/wrapper-validation') + } + const result = await validate.findInvalidWrapperJars( path.resolve('.'), +core.getInput('min-wrapper-count'), @@ -22,6 +32,8 @@ export async function run(): Promise { core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`) } } + + emitDeprecationWarnings(false) } catch (error) { handleMainActionError(error) }