Skip to content

Commit

Permalink
fix reChangedFilesTags regex
Browse files Browse the repository at this point in the history
it was not matching the files. prefix as it was supposed to, since the
dot would be anything
  • Loading branch information
chmouel committed May 3, 2024
1 parent a299120 commit e8a2251
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/matcher/cel.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import (
)

const (
// Utilizing this regex, the GetFiles function will be selectively executed exclusively when the "file."
// property is specified within the CEL expression.
changedFilesTags = "files."
reChangedFilesTags = `files\.`
)

func celEvaluate(ctx context.Context, expr string, event *info.Event, vcx provider.Interface) (ref.Val, error) {
Expand Down Expand Up @@ -62,7 +60,7 @@ func celEvaluate(ctx context.Context, expr string, event *info.Event, vcx provid
headerMap[strings.ToLower(k)] = v[0]
}

r := regexp.MustCompile(changedFilesTags)
r := regexp.MustCompile(reChangedFilesTags)
changedFiles := changedfiles.ChangedFiles{}

if r.MatchString(expr) {
Expand Down

0 comments on commit e8a2251

Please sign in to comment.