1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-09 07:42:52 +03:00

Use variables in pipeline (#1026)

use yaml aliases (https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases) to have pipeline `variables`

Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Co-authored-by: Anbraten <anton@ju60.de>
This commit is contained in:
6543
2022-07-17 18:25:56 +02:00
committed by GitHub
parent 31bad81979
commit 8da0ee47f7
8 changed files with 173 additions and 184 deletions

View File

@@ -26,7 +26,8 @@ func lint(c *cli.Context) error {
}
func lintDir(c *cli.Context, dir string) error {
return filepath.Walk(dir, func(path string, info os.FileInfo, e error) error {
var errorStrings []string
if err := filepath.Walk(dir, func(path string, info os.FileInfo, e error) error {
if e != nil {
return e
}
@@ -34,13 +35,22 @@ func lintDir(c *cli.Context, dir string) error {
// check if it is a regular file (not dir)
if info.Mode().IsRegular() && strings.HasSuffix(info.Name(), ".yml") {
fmt.Println("#", info.Name())
_ = lintFile(c, path) // TODO: should we drop errors or store them and report back?
if err := lintFile(c, path); err != nil {
errorStrings = append(errorStrings, err.Error())
}
fmt.Println("")
return nil
}
return nil
})
}); err != nil {
return err
}
if len(errorStrings) != 0 {
return fmt.Errorf("ERRORS: %s", strings.Join(errorStrings, "; "))
}
return nil
}
func lintFile(_ *cli.Context, file string) error {