Skip to content

Commit

Permalink
v4.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
skymoore committed Jun 10, 2024
1 parent b1e3fe4 commit 29a5081
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8852,12 +8852,16 @@ async function getRequiredCodeowners(changedFiles, repo, pr, octokit) {
continue;
}

const [pattern, ...owners] = line.trim().split(/\s+/);
let [pattern, ...owners] = line.trim().split(/\s+/);

if (pattern === '*') {
updateCodeowners(owners);
} else {
for (const changedFile of changedFiles) {
if (!pattern.startsWith('/')) {
pattern = `**/${pattern}`;
}
for (let changedFile of changedFiles) {
changedFile = `/${changedFile}`;
if (minimatch(changedFile, pattern)) {
updateCodeowners(owners);
}
Expand Down Expand Up @@ -8978,7 +8982,7 @@ async function main() {
);

const requiredCodeownerEntities = await getRequiredCodeowners(changedFiles, repo.data, pr, octokit);
console.info(`Required codeowners: ${JSON.stringify(requiredCodeownerEntities)}`);
console.info(`Required codeowners: ${Object.keys(requiredCodeownerEntities).join(', ')}`);

const orgTeams = [];

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "required-approvals",
"version": "4.2.0",
"version": "4.2.2",
"private": true,
"scripts": {
"build": "ncc build src/index.js -o dist"
Expand All @@ -9,4 +9,4 @@
"@octokit/rest": "^19.0.7",
"minimatch": "^9.0.0"
}
}
}

0 comments on commit 29a5081

Please sign in to comment.