diff --git a/internal/notifier/gitlab.go b/internal/notifier/gitlab.go index 9e976bd66..f276a9d7a 100644 --- a/internal/notifier/gitlab.go +++ b/internal/notifier/gitlab.go @@ -99,7 +99,9 @@ func (g *GitLab) Post(ctx context.Context, event eventv1.Event) error { Description: desc, } - getOpt := &gitlab.GetCommitStatusesOptions{} + getOpt := &gitlab.GetCommitStatusesOptions{ + Name: &status.Name, + } statuses, _, err := g.Client.Commits.GetCommitStatuses(g.Id, rev, getOpt, gitlab.WithContext(ctx)) if err != nil { return fmt.Errorf("unable to list commit status: %s", err) @@ -134,10 +136,8 @@ func toGitLabState(severity string) (gitlab.BuildStateValue, error) { func duplicateGitlabStatus(statuses []*gitlab.CommitStatus, status *gitlab.CommitStatus) bool { for _, s := range statuses { - if s.SHA == status.SHA { - if s.Status == status.Status && s.Description == status.Description && s.Name == status.Name { - return true - } + if s.Status == status.Status && s.Description == status.Description && s.Name == status.Name { + return true } }