auto-approver
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -72,6 +72,11 @@ "use strict"; | ||
getMatchingRepositories(repositories, regex) { | ||
return repositories.filter(repository => { | ||
const matchingRepositories = repository.pullRequests.filter(pullRequest => !!pullRequest.head.ref.match(regex)); | ||
return !!matchingRepositories.length; | ||
}); | ||
return repositories | ||
.map(repository => { | ||
const matchingPullRequests = repository.pullRequests.filter(pullRequest => new RegExp(regex).test(pullRequest.head.ref)); | ||
if (!!matchingPullRequests.length) { | ||
return { pullRequests: matchingPullRequests, repositorySlug: repository.repositorySlug }; | ||
} | ||
return undefined; | ||
}) | ||
.filter(Boolean); | ||
} | ||
@@ -78,0 +83,0 @@ commentByMatch(regex, comment, repositories) { |
@@ -0,1 +1,8 @@ | ||
## [1.6.2](https://github.com/ffflorian/auto-approver/compare/v1.6.1...v1.6.2) (2020-09-23) | ||
### Bug Fixes | ||
* Repository RegEx, better filtering, add tests ([a4d87ed](https://github.com/ffflorian/auto-approver/commit/a4d87ed4ec86c4a96ac2c47fbd449a46cc7326d0)) | ||
## [1.6.1](https://github.com/ffflorian/auto-approver/compare/v1.6.0...v1.6.1) (2020-09-18) | ||
@@ -2,0 +9,0 @@ |
@@ -50,3 +50,3 @@ #!/usr/bin/env node | ||
if (configFileData.useComment) { | ||
const commentResult = yield autoApprover.commentByMatch(new RegExp(pullRequestSlug), configFileData.useComment, repositories); | ||
const commentResult = yield autoApprover.commentByMatch(new RegExp(`${pullRequestSlug}/gi`), configFileData.useComment, repositories); | ||
const commentedRepositories = commentResult.reduce((count, repository) => count + repository.actionResults.length, 0); | ||
@@ -57,3 +57,3 @@ const pluralSingular = util_1.pluralize('request', commentedRepositories); | ||
else { | ||
const approveResult = yield autoApprover.approveByMatch(new RegExp(pullRequestSlug), repositories); | ||
const approveResult = yield autoApprover.approveByMatch(new RegExp(`${pullRequestSlug}/gi`), repositories); | ||
const approvedRepositories = approveResult.reduce((count, repository) => count + repository.actionResults.length, 0); | ||
@@ -60,0 +60,0 @@ const pluralSingular = util_1.pluralize('request', approvedRepositories); |
@@ -33,3 +33,3 @@ { | ||
"eslint-plugin-sort-keys-fix": "1.1.1", | ||
"eslint-plugin-typescript-sort-keys": "1.3.0", | ||
"eslint-plugin-typescript-sort-keys": "1.5.0", | ||
"http-status-codes": "2.1.4", | ||
@@ -110,3 +110,3 @@ "husky": "4.3.0", | ||
}, | ||
"version": "1.6.2" | ||
"version": "1.6.3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
69963
360