Skip to content

Commit

Permalink
v4.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
skymoore committed Jul 2, 2024
1 parent 4284bc3 commit 3fcc7e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
12 changes: 8 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8857,12 +8857,16 @@ async function getRequiredCodeowners(changedFiles, repo, pr, octokit) {
if (pattern === '*') {
updateCodeowners(owners);
} else {
if (!pattern.startsWith('/')) {
if (!pattern.startsWith('/') && !pattern.startsWith('*')) {
pattern = `**/${pattern}`;
}
if (!path.extname(pattern) && !pattern.endsWith('*')) {
pattern = `${pattern}/**`;
}
for (let changedFile of changedFiles) {
changedFile = `/${changedFile}`;
if (minimatch(changedFile, pattern)) {
if (minimatch(changedFile, pattern, { dot: true })) {
console.log(`Match found: File - ${changedFile}, Pattern - ${pattern}`);
updateCodeowners(owners);
}
}
Expand Down Expand Up @@ -8984,7 +8988,7 @@ async function main() {
const requiredCodeownerEntities = await getRequiredCodeowners(changedFiles, repo.data, pr, octokit);
console.info(`Required codeowners: ${Object.keys(requiredCodeownerEntities).join(', ')}`);

const orgTeams = [];
let orgTeams = [];

if (process.env["INPUT_LIMIT_ORG_TEAMS_TO_CODEOWNERS_FILE"] === "true") {
const requiredCodeownerEntitySlugs = new Set(Object.keys(requiredCodeownerEntities));
Expand All @@ -9004,7 +9008,7 @@ async function main() {
orgTeams = allOrgTeams;
}

const approvedCodeowners = [];
let approvedCodeowners = [];

for (const review of reviews) {
const userTeams = await getUserTeams(review.user.login, orgName, orgTeams, readOrgOctokit);
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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "required-approvals",
"version": "4.2.3",
"version": "4.2.4",
"private": true,
"scripts": {
"build": "ncc build src/index.js -o dist"
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async function main() {
const requiredCodeownerEntities = await getRequiredCodeowners(changedFiles, repo.data, pr, octokit);
console.info(`Required codeowners: ${Object.keys(requiredCodeownerEntities).join(', ')}`);

const orgTeams = [];
let orgTeams = [];

if (process.env["INPUT_LIMIT_ORG_TEAMS_TO_CODEOWNERS_FILE"] === "true") {
const requiredCodeownerEntitySlugs = new Set(Object.keys(requiredCodeownerEntities));
Expand All @@ -200,7 +200,7 @@ async function main() {
orgTeams = allOrgTeams;
}

const approvedCodeowners = [];
let approvedCodeowners = [];

for (const review of reviews) {
const userTeams = await getUserTeams(review.user.login, orgName, orgTeams, readOrgOctokit);
Expand Down

0 comments on commit 3fcc7e6

Please sign in to comment.