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

* 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

View file

@ -36,7 +36,7 @@ import (
var (
// 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")
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")

View file

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