mirror of
https://github.com/thegeeklab/drone-yaml.git
synced 2024-11-24 11:00:39 +00:00
ignore nil settings
This commit is contained in:
parent
0e9ca9cdb9
commit
3be804f3da
@ -86,6 +86,10 @@ func createStep(spec *engine.Spec, src *yaml.Container) *engine.Step {
|
|||||||
// appends the environment variables to the
|
// appends the environment variables to the
|
||||||
// container definition.
|
// container definition.
|
||||||
for key, value := range src.Environment {
|
for key, value := range src.Environment {
|
||||||
|
// fix https://github.com/drone/drone-yaml/issues/13
|
||||||
|
if value == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if value.Secret != "" {
|
if value.Secret != "" {
|
||||||
sec := &engine.SecretVar{
|
sec := &engine.SecretVar{
|
||||||
Name: value.Secret,
|
Name: value.Secret,
|
||||||
@ -100,6 +104,10 @@ func createStep(spec *engine.Spec, src *yaml.Container) *engine.Step {
|
|||||||
// appends the settings variables to the
|
// appends the settings variables to the
|
||||||
// container definition.
|
// container definition.
|
||||||
for key, value := range src.Settings {
|
for key, value := range src.Settings {
|
||||||
|
// fix https://github.com/drone/drone-yaml/issues/13
|
||||||
|
if value == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
// all settings are passed to the plugin env
|
// all settings are passed to the plugin env
|
||||||
// variables, prefixed with PLUGIN_
|
// variables, prefixed with PLUGIN_
|
||||||
key = "PLUGIN_" + strings.ToUpper(key)
|
key = "PLUGIN_" + strings.ToUpper(key)
|
||||||
|
Loading…
Reference in New Issue
Block a user