Skip to content

Commit 1efcab1

Browse files
committed
chore: tweak naming
1 parent 85a2105 commit 1efcab1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pkg/config/ignore_activity_from.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package config
22

3-
type ActorMatcher struct {
3+
type Actor struct {
44
Username string
55
Email *string
66
IsBot bool
@@ -12,7 +12,7 @@ type IgnoreActivityFrom struct {
1212
Emails []string `yaml:"emails"`
1313
}
1414

15-
func (i IgnoreActivityFrom) Matches(actor ActorMatcher) bool {
15+
func (i IgnoreActivityFrom) Matches(actor Actor) bool {
1616
// If actor is bot and we ignore bot activity
1717
if actor.IsBot && i.IsBot {
1818
return true

pkg/scm/gitlab/context_merge_request.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (e ContextMergeRequest) HasAnyActivityWithin(ctx context.Context, input any
6565

6666
for _, note := range e.Notes {
6767
// Check if we should ignore the actor (user) activity
68-
if cfg.IgnoreActivityFrom.Matches(note.Author.ToActorMatcher()) {
68+
if cfg.IgnoreActivityFrom.Matches(note.Author.ToActor()) {
6969
continue
7070
}
7171

@@ -92,7 +92,7 @@ func (e ContextMergeRequest) HasUserActivityWithin(ctx context.Context, input an
9292

9393
for _, note := range e.Notes {
9494
// Check if we should ignore the actor (user) activity
95-
if cfg.IgnoreActivityFrom.Matches(note.Author.ToActorMatcher()) {
95+
if cfg.IgnoreActivityFrom.Matches(note.Author.ToActor()) {
9696
continue
9797
}
9898

pkg/scm/gitlab/context_user.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package gitlab
22

33
import "github.com/jippi/scm-engine/pkg/config"
44

5-
func (u ContextUser) ToActorMatcher() config.ActorMatcher {
6-
return config.ActorMatcher{
5+
func (u ContextUser) ToActor() config.Actor {
6+
return config.Actor{
77
Username: u.Username,
88
IsBot: u.Bot,
99
Email: u.PublicEmail,

0 commit comments

Comments
 (0)