mirror of
				https://github.com/ButlerLogic/action-autotag.git
				synced 2025-10-31 23:36:22 +07:00 
			
		
		
		
	fix: ensure that versions are valid SerVer before comparing
This commit is contained in:
		 Tomasz Pluskiewicz
					Tomasz Pluskiewicz
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							2451ded74e
						
					
				
				
					commit
					f558f9692c
				
			
							
								
								
									
										13
									
								
								app/main.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								app/main.js
									
									
									
									
									
								
							| @ -51,7 +51,18 @@ async function run () { | ||||
|     } | ||||
|  | ||||
|     const minVersion = core.getInput('minVersion', { required: false }) | ||||
|     if (semver.lt(version, minVersion)) { | ||||
|      | ||||
|     // Ensure that version and minVersion are valid SemVer strings | ||||
|     const minVersionSemVer = semver.coerce(minVersion) | ||||
|     const versionSemVer = semver.coerce(version) | ||||
|     if (!minVersionSemVer) { | ||||
|       core.warning(`Skipping min version check. ${minVersion} is not valid SemVer`) | ||||
|     } | ||||
|     if(!versionSemVer) { | ||||
|       core.warning(`Skipping min version check. ${version} is not valid SemVer`) | ||||
|     } | ||||
|      | ||||
|     if (minVersionSemVer && versionSemVer && semver.lt(versionSemVer, minVersion)) { | ||||
|       core.warning(`Version "${version}" is lower than minimum "${minVersion}"`) | ||||
|       return | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user