mirror of
				https://hub.gitmirror.com/https://github.com/gradle/actions.git
				synced 2025-10-28 08:30:02 +08:00 
			
		
		
		
	Deprecate 'wrapper-validation-action'
Deprecation warning will be emitted when we: - Change 'wrapper-validation-action' to delegate to 'actions/wrapper-validation' - Add the 'wrapper-validation-action' id as env var before delegating
This commit is contained in:
		
							parent
							
								
									0325d99e52
								
							
						
					
					
						commit
						6d55902761
					
				| @ -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 | ||||
|  | ||||
| @ -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()}`) | ||||
|  | ||||
| @ -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<void> { | ||||
|     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<void> { | ||||
|                 core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`) | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         emitDeprecationWarnings(false) | ||||
|     } catch (error) { | ||||
|         handleMainActionError(error) | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 daz
						daz