Skip to content

Commit 2cbebeb

Browse files
committed
Change to the pattern in the user check of the ignore config
1 parent ba8b057 commit 2cbebeb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/main/java/org/hibernate/infra/bot/CheckPullRequestContributionRules.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ private boolean shouldCheckPullRequest(PullRequestCheckRunContext context) throw
246246
GHUser author = context.pullRequest.getUser();
247247
String title = context.pullRequest.getTitle();
248248
for ( RepositoryConfig.IgnoreConfiguration ignore : ignoredPRConfigurations ) {
249-
if ( ignore.getUser().equals( author.getLogin() )
249+
if ( ignore.getUserPattern().matcher( author.getLogin() ).matches()
250250
&& ignore.getTitlePattern().matcher( title ).matches() ) {
251251
return false;
252252
}

src/main/java/org/hibernate/infra/bot/config/RepositoryConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ public void setIgnoreFiles(List<String> ignoreFiles) {
6767

6868
public static class IgnoreConfiguration {
6969

70-
private String user;
70+
private Pattern userPattern;
7171
private Pattern titlePattern;
7272

73-
public String getUser() {
74-
return user;
73+
public Pattern getUserPattern() {
74+
return userPattern;
7575
}
7676

77-
public void setUser(String user) {
78-
this.user = user;
77+
public void setUserPattern(String userPattern) {
78+
this.userPattern = Patterns.compile( userPattern );
7979
}
8080

8181
public Pattern getTitlePattern() {

src/test/java/org/hibernate/infra/bot/tests/CheckPullRequestContributionRulesJiraTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void ignore_dependabotOpensBuildDependencyUpgradePullRequest() throws IOExceptio
286286
jira:
287287
projectKey: "HSEARCH"
288288
ignore:
289-
- user: dependabot[bot]
289+
- userPattern: dependabot\\[bot\\]
290290
titlePattern: ".*\\\\bmaven\\\\b.*\\\\bplugin\\\\b.*"
291291
""" );
292292

0 commit comments

Comments
 (0)