Merge pull request #313 from denysvitali/feature/fix-defaults

fix: add default values in vmInput
This commit is contained in:
Casey Lee 2020-07-21 06:50:14 -07:00 committed by GitHub
commit 8245d23e1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -296,6 +296,14 @@ func (sc *StepContext) vmEnv() func(*otto.Otto) {
func (sc *StepContext) vmInputs() func(*otto.Otto) {
inputs := make(map[string]string)
// Set Defaults
if sc.Action != nil {
for k, input := range sc.Action.Inputs {
inputs[k] = input.Default
}
}
for k, v := range sc.Step.With {
inputs[k] = v
}

View file

@ -5,6 +5,6 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/hello-world-docker-action@master
- uses: actions/hello-world-docker-action@main
with:
who-to-greet: 'Mona the Octocat'