mirror of
				https://github.com/deployphp/action.git
				synced 2025-11-04 08:20:57 +00:00 
			
		
		
		
	Add ansi and verbosity input options
This commit is contained in:
		
					parent
					
						
							
								0bf91d3ad5
							
						
					
				
			
			
				commit
				
					
						f34965b21f
					
				
			
		
					 3 changed files with 21 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -51,6 +51,14 @@
 | 
			
		|||
      # You can specify path to your local Deployer binary in the repo.
 | 
			
		||||
      # Optional.
 | 
			
		||||
      deployer-binary: "bin/dep"
 | 
			
		||||
 | 
			
		||||
      # You can choose to disable ANSI output.
 | 
			
		||||
      # Optional. Defaults to true.
 | 
			
		||||
      ansi: false
 | 
			
		||||
 | 
			
		||||
      # You can specify the output verbosity level.
 | 
			
		||||
      # Optional. Defaults to -v.
 | 
			
		||||
      verbosity: -vvv
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Example
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										10
									
								
								action.yaml
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								action.yaml
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -32,6 +32,16 @@ inputs:
 | 
			
		|||
    default: ''
 | 
			
		||||
    description: Path to local Deployer binary.
 | 
			
		||||
 | 
			
		||||
  ansi:
 | 
			
		||||
    required: false
 | 
			
		||||
    default: 'true'
 | 
			
		||||
    description: Whether to enable ANSI output.
 | 
			
		||||
 | 
			
		||||
  verbosity:
 | 
			
		||||
    required: false
 | 
			
		||||
    default: '-v'
 | 
			
		||||
    description: Verbosity level Can be -v, -vv or -vvv.
 | 
			
		||||
 | 
			
		||||
runs:
 | 
			
		||||
  using: 'node12'
 | 
			
		||||
  main: 'index.js'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								index.js
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								index.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -81,8 +81,10 @@ async function dep() {
 | 
			
		|||
  }
 | 
			
		||||
 | 
			
		||||
  let cmd = core.getInput('dep')
 | 
			
		||||
  let ansi = core.getBooleanInput('ansi') ? '--ansi' : '--no-ansi';
 | 
			
		||||
  let verbosity = core.getInput('verbosity');
 | 
			
		||||
 | 
			
		||||
  let p = execa.command(`php ${dep} --no-interaction --ansi -v ${cmd}`)
 | 
			
		||||
  let p = execa.command(`php ${dep} --no-interaction ${ansi} ${verbosity} ${cmd}`)
 | 
			
		||||
  p.stdout.pipe(process.stdout)
 | 
			
		||||
  p.stderr.pipe(process.stderr)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue