mirror of
				https://hub.gitmirror.com/https://github.com/gradle/actions.git
				synced 2025-10-28 08:30:02 +08:00 
			
		
		
		
	 07023d3e3e
			
		
	
	
		07023d3e3e
		
			
		
	
	
	
	
		
			
			Moved reading of all input parameters into a common source: `input-params.ts`. This centralized all input parameter reads, and allowed an improved implementation of reading boolean parameters. In particular, the implementation now provides a default value for a boolean input parameter that isn't declared for an action.
		
			
				
	
	
		
			17 lines
		
	
	
		
			558 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			558 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import * as params from './input-params'
 | |
| import * as path from 'path'
 | |
| 
 | |
| export function workspaceDirectory(): string {
 | |
|     return process.env[`GITHUB_WORKSPACE`] || ''
 | |
| }
 | |
| 
 | |
| export function buildRootDirectory(): string {
 | |
|     const baseDirectory = workspaceDirectory()
 | |
|     const buildRootDirectoryInput = params.getBuildRootDirectory()
 | |
|     const resolvedBuildRootDirectory =
 | |
|         buildRootDirectoryInput === ''
 | |
|             ? path.resolve(baseDirectory)
 | |
|             : path.resolve(baseDirectory, buildRootDirectoryInput)
 | |
|     return resolvedBuildRootDirectory
 | |
| }
 |