Skip to content

Commit d8451ae

Browse files
committed
Ignore generated CRDs during size check
1 parent 7a444b1 commit d8451ae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bot/internal/bot/bot.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package bot
1818

1919
import (
2020
"context"
21+
"regexp"
2122
"strings"
2223

2324
"github.com/gravitational/trace"
@@ -28,6 +29,10 @@ import (
2829
"github.com/gravitational/shared-workflows/bot/internal/review"
2930
)
3031

32+
// isCRDRegex matches Teleport operator CRD file paths.
33+
// Those files receive a special treatment as they're automatically generated.
34+
var isCRDRegex = regexp.MustCompile(`.*/resources\.teleport\.dev_[[:alpha:]]+\.yaml$`)
35+
3136
// Client implements the GitHub API.
3237
type Client interface {
3338
// RequestReviewers is used to assign reviewers to a Pull Request.
@@ -265,7 +270,8 @@ func skipFileForSizeCheck(name string) bool {
265270
strings.HasSuffix(name, "_pb.d.ts") ||
266271
strings.HasSuffix(name, ".json") ||
267272
strings.Contains(name, "webassets/") ||
268-
strings.Contains(name, "vendor/")
273+
strings.Contains(name, "vendor/") ||
274+
isCRDRegex.MatchString(name)
269275
}
270276

271277
func isReleaseBranch(branch string) bool {

0 commit comments

Comments
 (0)