mirror of
https://github.com/deployphp/action.git
synced 2025-03-31 02:16:36 +00:00
add test action, prevent failure on empty options
This commit is contained in:
parent
f80227ccd3
commit
b74d35cf2b
2 changed files with 26 additions and 5 deletions
17
.github/workflows/test.yml
vendored
Normal file
17
.github/workflows/test.yml
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
name: 'build-test'
|
||||
on: # rebuild any PRs and main branch changes
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'releases/*'
|
||||
|
||||
jobs:
|
||||
test: # make sure the action works on a clean machine without building
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./
|
||||
with:
|
||||
dep: list
|
||||
deployer-version: "7.3.0"
|
14
index.js
14
index.js
|
@ -109,12 +109,16 @@ async function dep() {
|
|||
let ansi = core.getBooleanInput('ansi') ? '--ansi' : '--no-ansi'
|
||||
let verbosity = core.getInput('verbosity')
|
||||
let options = []
|
||||
try {
|
||||
for (let [key, value] in Object.entries(JSON.parse(core.getInput('options')))) {
|
||||
options.push('-o', `${key}=${value}`)
|
||||
let optionsInput = core.getInput('options');
|
||||
|
||||
if (optionsInput !== '') {
|
||||
try {
|
||||
for (let [key, value] in Object.entries(JSON.parse(optionsInput))) {
|
||||
options.push('-o', `${key}=${value}`)
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error('Invalid JSON in options')
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error('Invalid JSON in options')
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Reference in a new issue