mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
add linter to exec
This commit is contained in:
parent
797bb4970f
commit
7f533927c7
1 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/cncd/pipeline/pipeline/frontend"
|
||||
"github.com/cncd/pipeline/pipeline/frontend/yaml"
|
||||
"github.com/cncd/pipeline/pipeline/frontend/yaml/compiler"
|
||||
"github.com/cncd/pipeline/pipeline/frontend/yaml/linter"
|
||||
"github.com/cncd/pipeline/pipeline/interrupt"
|
||||
"github.com/cncd/pipeline/pipeline/multipart"
|
||||
"github.com/drone/envsubst"
|
||||
|
@ -325,6 +326,11 @@ func exec(c *cli.Context) error {
|
|||
volumes = append(volumes, dir+":"+path.Join(workspaceBase, workspacePath))
|
||||
}
|
||||
|
||||
// lint the yaml file
|
||||
if lerr := linter.New(linter.WithTrusted(true)).Lint(conf); lerr != nil {
|
||||
return lerr
|
||||
}
|
||||
|
||||
// compiles the yaml file
|
||||
compiled := compiler.New(
|
||||
compiler.WithEscalated(
|
||||
|
|
Loading…
Reference in a new issue