Skip to content

Commit 250c5e8

Browse files
committed
chore: move 'Actor' to 'scm' pkg instead of 'config
1 parent 1efcab1 commit 250c5e8

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

pkg/config/ignore_activity_from.go

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

3-
type Actor struct {
4-
Username string
5-
Email *string
6-
IsBot bool
7-
}
3+
import "github.com/jippi/scm-engine/pkg/scm"
84

95
type IgnoreActivityFrom struct {
106
IsBot bool `yaml:"bots"`
117
Usernames []string `yaml:"usernames"`
128
Emails []string `yaml:"emails"`
139
}
1410

15-
func (i IgnoreActivityFrom) Matches(actor Actor) bool {
11+
func (i IgnoreActivityFrom) Matches(actor scm.Actor) bool {
1612
// If actor is bot and we ignore bot activity
1713
if actor.IsBot && i.IsBot {
1814
return true

pkg/scm/gitlab/context_user.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package gitlab
22

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

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

pkg/scm/types.go

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ import (
99
"github.com/jippi/scm-engine/pkg/types"
1010
)
1111

12+
type Actor struct {
13+
Username string
14+
Email *string
15+
IsBot bool
16+
}
17+
1218
// Label represents a GitLab label.
1319
//
1420
// GitLab API docs: https://docs.gitlab.com/ee/api/labels.html

0 commit comments

Comments
 (0)