fix: nil pointer access ( workflow_dispatch )

This commit is contained in:
ChristopherHX
2022-11-10 21:16:00 +01:00
committed by GitHub
parent cf00e8d9bb
commit d97481d567
5 changed files with 50 additions and 9 deletions

View File

@@ -331,15 +331,17 @@ func getEvaluatorInputs(ctx context.Context, rc *RunContext, step step, ghc *mod
if ghc.EventName == "workflow_dispatch" {
config := rc.Run.Workflow.WorkflowDispatchConfig()
for k, v := range config.Inputs {
value := nestedMapLookup(ghc.Event, "inputs", k)
if value == nil {
value = v.Default
}
if v.Type == "boolean" {
inputs[k] = value == "true"
} else {
inputs[k] = value
if config != nil && config.Inputs != nil {
for k, v := range config.Inputs {
value := nestedMapLookup(ghc.Event, "inputs", k)
if value == nil {
value = v.Default
}
if v.Type == "boolean" {
inputs[k] = value == "true"
} else {
inputs[k] = value
}
}
}
}