1
0
mirror of https://github.com/harness/drone.git synced 2025-04-28 05:36:58 +00:00

fix templating reg expression to match if .drone.yml contains --- characters ()

* issue with regular expression for templates not picking up --- in drone.yml file
This commit is contained in:
Eoin McAfee 2021-09-01 15:06:03 +01:00 committed by GitHub
parent 5426fb7b31
commit e8fb0cfca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions
plugin/converter

@ -36,7 +36,7 @@ import (
var ( var (
// templateFileRE regex to verifying kind is template. // templateFileRE regex to verifying kind is template.
templateFileRE = regexp.MustCompile("^kind:\\s+template+\\n") templateFileRE = regexp.MustCompilePOSIX("^kind:[[:space:]]+template[[:space:]]?+$")
errTemplateNotFound = errors.New("template converter: template name given not found") errTemplateNotFound = errors.New("template converter: template name given not found")
errTemplateSyntaxErrors = errors.New("template converter: there is a problem with the yaml file provided") errTemplateSyntaxErrors = errors.New("template converter: there is a problem with the yaml file provided")
errTemplateExtensionInvalid = errors.New("template extension invalid. must be yaml, starlark or jsonnet") errTemplateExtensionInvalid = errors.New("template extension invalid. must be yaml, starlark or jsonnet")

@ -1,3 +1,4 @@
---
kind: template kind: template
load: plugin.starlark load: plugin.starlark
data: data: