Add warning for long secret names.
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
1e6a6e6174
commit
a150f227bc
|
@ -115,6 +115,13 @@ var LintRules = map[string][]LintRule{
|
||||||
HowToResolve: "upload your recipe to git.coopcloud.tech/coop-cloud/...",
|
HowToResolve: "upload your recipe to git.coopcloud.tech/coop-cloud/...",
|
||||||
Function: LintHasRecipeRepo,
|
Function: LintHasRecipeRepo,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Ref: "R014",
|
||||||
|
Level: "warn",
|
||||||
|
Description: "Long secret names",
|
||||||
|
HowToResolve: "Reduce the lenght of secret names to 12 characters.",
|
||||||
|
Function: LintSecretLengths,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
{
|
{
|
||||||
|
@ -401,6 +408,16 @@ func LintHasRecipeRepo(recipe recipe.Recipe) (bool, error) {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func LintSecretLengths(recipe recipe.Recipe) (bool, error) {
|
||||||
|
for name := range recipe.Config.Secrets {
|
||||||
|
if len(name) > 12 {
|
||||||
|
return false, fmt.Errorf("secret %s is longer than 12 characters", name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
func LintValidTags(recipe recipe.Recipe) (bool, error) {
|
func LintValidTags(recipe recipe.Recipe) (bool, error) {
|
||||||
recipeDir := path.Join(config.RECIPES_DIR, recipe.Name)
|
recipeDir := path.Join(config.RECIPES_DIR, recipe.Name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue