mirror of
				https://github.com/ButlerLogic/action-autotag.git
				synced 2025-10-31 23:36:22 +07:00 
			
		
		
		
	Merge branch 'master' into min-version-21
This commit is contained in:
		
							
								
								
									
										15
									
								
								app/main.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								app/main.js
									
									
									
									
									
								
							| @ -19,6 +19,8 @@ async function run () { | ||||
|     const root = core.getInput('root', { required: false }) || core.getInput('package_root', { required: false }) || './' | ||||
|     const strategy = (core.getInput('regex_pattern', { required: false }) || '').trim().length > 0 ? 'regex' : ((core.getInput('strategy', { required: false }) || 'package').trim().toLowerCase()) | ||||
|  | ||||
|     // If this value is true, the tag will not be pushed | ||||
|     const isDryRun = core.getInput('dry_run', { required: false }); | ||||
|  | ||||
|     // Extract the version number using the supplied strategy | ||||
|     let version = core.getInput('root', { required: false }) | ||||
| @ -78,22 +80,29 @@ async function run () { | ||||
|       core.getInput('tag_suffix', { required: false }) | ||||
|     ) | ||||
|  | ||||
|     core.warning(`Attempting to create ${tag.name} tag.`) | ||||
|     if (isDryRun === "true") { | ||||
|       core.warning(`"${tag.name}" tag is not pushed because the dry_run option was set.`) | ||||
|     } else { | ||||
|       core.warning(`Attempting to create ${tag.name} tag.`) | ||||
|     } | ||||
|  | ||||
|     core.setOutput('tagrequested', tag.name) | ||||
|     core.setOutput('prerelease', tag.prerelease ? 'yes' : 'no') | ||||
|     core.setOutput('build', tag.build ? 'yes' : 'no') | ||||
|  | ||||
|     // Check for existance of tag and abort (short circuit) if it already exists. | ||||
|     if (await tag.exists()) { | ||||
|       core.warning(`"${tag.name}" tag already exists.` + os.EOL) | ||||
|       core.setFailed(`"${tag.name}" tag already exists.` + os.EOL) | ||||
|       core.setOutput('tagname', '') | ||||
|       return | ||||
|     } | ||||
|  | ||||
|     // The tag setter will autocorrect the message if necessary. | ||||
|     tag.message = core.getInput('tag_message', { required: false }).trim() | ||||
|     await tag.push() | ||||
|  | ||||
|     if (isDryRun !== "true") { | ||||
|       await tag.push() | ||||
|     } | ||||
|     core.setOutput('tagname', tag.name) | ||||
|     core.setOutput('tagsha', tag.sha) | ||||
|     core.setOutput('taguri', tag.uri) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Corey Butler
					Corey Butler