✨(action.yml): adiciona input 'command' para controlar execução condicional de etapas no workflow
This commit is contained in:
13
action.yml
13
action.yml
@@ -1,4 +1,4 @@
|
||||
name: 'TC Deployment'
|
||||
name: 'Deployment'
|
||||
description: 'Trigger deployment webhook and report to Sentry'
|
||||
inputs:
|
||||
service:
|
||||
@@ -30,6 +30,10 @@ inputs:
|
||||
description: 'Timeout in ms'
|
||||
required: false
|
||||
default: '3600000'
|
||||
command:
|
||||
description: 'Command to run (deploy, hello)'
|
||||
required: false
|
||||
default: 'deploy'
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@@ -39,12 +43,19 @@ runs:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install dependencies
|
||||
if: inputs.command == 'deploy'
|
||||
shell: bash
|
||||
run: |
|
||||
cd ${{ github.action_path }}
|
||||
npm install --no-save --omit=dev
|
||||
|
||||
- name: Hello World
|
||||
if: inputs.command == 'hello'
|
||||
shell: bash
|
||||
run: echo "Hello World"
|
||||
|
||||
- name: Run deployment script
|
||||
if: inputs.command == 'deploy'
|
||||
shell: bash
|
||||
run: node ${{ github.action_path }}/main.js
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user