Skip to content

Commit

Permalink
Adjust matcher to ensure there is a rule for the entire package
Browse files Browse the repository at this point in the history
  • Loading branch information
Gudahtt committed Feb 17, 2025
1 parent 6d22c09 commit 06d5462
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,9 @@ async function expectCodeowner(workspace, workspaceBasename) {
const codeownerRules = codeownersFile.split('\n');

const packageCodeownerRule = codeownerRules.find((rule) =>
rule.startsWith(`/packages/${workspaceBasename}`),
// Matcher includes intentional trailing space to ensure there is a package-wide rule, not
// just a rule for specific files/directories in the package.
rule.startsWith(`/packages/${workspaceBasename} `),
);

if (!packageCodeownerRule) {
Expand Down

0 comments on commit 06d5462

Please sign in to comment.