Add default error case for Runs.Using (#221)

The string comparison in `step_context.go` is currently case sensitive. This commit adds an error that returns the valid options and tells the user what value they passed
This commit is contained in:
Michael Heap 2020-05-04 04:55:20 +01:00 committed by GitHub
parent a48cce3a78
commit 195a6c9ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -306,8 +306,12 @@ func (sc *StepContext) runAction(actionDir string, actionPath string) common.Exe
).Finally(
stepContainer.Remove().IfBool(!rc.Config.ReuseContainers),
)(ctx)
default:
return fmt.Errorf(fmt.Sprintf("The runs.using key in action.yml must be one of: %v, got %s", []string{
model.ActionRunsUsingDocker,
model.ActionRunsUsingNode12,
}, action.Runs.Using))
}
return nil
}
}