skymoore / required-approvals

Github Action to check PR approvals and codeowners
7 stars 7 forks source link

Patterns for files in repo root are no longer matched #19

Closed druchoo closed 3 weeks ago

druchoo commented 3 months ago

The following changes seem to break evaluating patterns for files in the repo's root:

For example, with a CODEOWNERS file as follows, the my-file file is not matched.

my-file @MyOrg/my-team

The file will match both if conditions (https://github.com/skymoore/required-approvals/blob/main/src/index.js#L52-L57) and set pattern to my-file/** and changedFile to /my-file. minimatch then fails to match.

minimatch("/my-file", "my-file/**", { dot: true })

Converting https://github.com/skymoore/required-approvals/blob/main/src/index.js#L52-L57 to an if/else would fix but I'm not sure if that is best approach.

skymoore commented 3 months ago

@AlvaroGG0 I'm going to take a look at this, would appreciate your input as well.

skymoore commented 3 months ago

@druchoo Thanks for submitting this. Will get it sorted.

skymoore commented 2 months ago

@druchoo check v4.2.5 please.

skymoore commented 2 months ago

@AlvaroGG0 Thank you for the PR!

skymoore commented 3 weeks ago

@druchoo @AlvaroGG0 Closing this one since no complaints after last PR.