Skip to content

Commit

Permalink
validate code template in workflows (#4822)
Browse files Browse the repository at this point in the history
* validate code template in workflows

* fix missing executer
  • Loading branch information
tarunKoyalwar committed Mar 1, 2024
1 parent 4c7a0f4 commit e86f382
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/templates/workflows.go
Expand Up @@ -80,6 +80,16 @@ func parseWorkflowTemplate(workflow *workflows.WorkflowTemplate, preprocessor Pr
gologger.Warning().Msgf("Could not parse workflow template %s: no executer found\n", path)
continue
}
if len(template.RequestsCode) > 0 {
if !options.Options.EnableCodeTemplates {
gologger.Warning().Msgf("`-code` flag not found, skipping code template from workflow: %v\n", path)
continue
} else if !template.Verified {
// unverfied code templates are not allowed in workflows
gologger.Warning().Msgf("skipping unverified code template from workflow: %v\n", path)
continue
}
}
workflowTemplates = append(workflowTemplates, template)
}

Expand Down

0 comments on commit e86f382

Please sign in to comment.