Skip to content

Change to the pattern in the user check of the ignore config #291

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

Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private boolean shouldCheckPullRequest(PullRequestCheckRunContext context) throw
GHUser author = context.pullRequest.getUser();
String title = context.pullRequest.getTitle();
for ( RepositoryConfig.IgnoreConfiguration ignore : ignoredPRConfigurations ) {
if ( ignore.getUser().equals( author.getLogin() )
if ( ignore.getUserPattern().matcher( author.getLogin() ).matches()
&& ignore.getTitlePattern().matcher( title ).matches() ) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public void setIgnoreFiles(List<String> ignoreFiles) {

public static class IgnoreConfiguration {

private String user;
private Pattern userPattern;
private Pattern titlePattern;

public String getUser() {
return user;
public Pattern getUserPattern() {
return userPattern;
}

public void setUser(String user) {
this.user = user;
public void setUserPattern(String userPattern) {
this.userPattern = Patterns.compile( userPattern );
}

public Pattern getTitlePattern() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void ignore_dependabotOpensBuildDependencyUpgradePullRequest() throws IOExceptio
jira:
projectKey: "HSEARCH"
ignore:
- user: dependabot[bot]
- userPattern: dependabot\\[bot\\]
titlePattern: ".*\\\\bmaven\\\\b.*\\\\bplugin\\\\b.*"
""" );

Expand Down
Loading