Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix can merge with additional roles #126

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions pkg/condition_author_can_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ func AuthorCanMergeCondition() Condition {
return false, fmt.Errorf("author-can-merge doesn't have a valid value in config")
}

ghRepo := target.ghPR.GetAuthorAssociation()
canMerge := ghRepo == "OWNER"
authorAssoc := target.ghPR.GetAuthorAssociation()
canMerge := authorAssoc == "MEMBER" || authorAssoc == "OWNER" || authorAssoc == "COLLABORATOR"

if expected && canMerge {
fmt.Printf("User: %s can merge %t, condition matched\n",
target.Author, canMerge)
fmt.Printf("User: %s can merge, condition matched\n", target.Author)
return true, nil
}

if !expected && !canMerge {
fmt.Printf("User: %s can not merge %t, condition matched\n",
target.Author, canMerge)
fmt.Printf("User: %s can not merge, condition matched\n",
target.Author)
return true, nil
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/labeler.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,6 @@ func (l *Labeler) findMatches(target *Target, config *LabelerConfigV1) (LabelUpd
} else { // First condition evaluated for this label
labelUpdates.set[label] = isMatched
}

if isMatched {
continue
}
}

if matcher.Negate {
Expand Down
Loading