-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore ghost user #53
Conversation
Codecov Report
@@ Coverage Diff @@
## master #53 +/- ##
==========================================
+ Coverage 43.81% 45.82% +2.00%
==========================================
Files 12 13 +1
Lines 372 371 -1
==========================================
+ Hits 163 170 +7
+ Misses 207 199 -8
Partials 2 2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi
many thanks for your contribution!
I have one suggestion. Instead of hard-coding the @ghost user name, it would be better to export the option which takes a list of owners e.g. users, teams etc. that should be ignored by Valid Owner Checker.
-
Add
IgnoreOwners []string `envconfig:"default=@ghost"`
property in line 15 in fileinternal/check/valid_owner.go
. In this way, this property can be automatically set by environment variableOWNER_CHECKER_IGNORE_OWNERS
which can be populated with list of owners names that should be ignored and not validated e.g."@user,@org/team1,@ghost"
-
In constructor
NewValidOwner
handle new cfg property and provide a funcshouldIgnoreGitHubOwner(name)
which can be used infor _, ownerName := range entry.Owners
loop in line 63:
if v.shouldIgnoreGitHubOwner(ownerName) {
continue
}
-
Update README.md that there is a new environment variable
OWNER_CHECKER_IGNORE_OWNERS
which can be used -
Update
action.yml
with new property
If you will any help then ping me :) or if you will not have time to finish that then I can take it over if you want 👍
} | ||
} | ||
|
||
func isValidUser(user string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func isValidUser(user string) bool { | |
func isValidOwner(user string) bool { |
owner is a generic name for users, teams and emails :)
Hi, I decided to merge that PR as it is 100% valid. I extracted the generalization logic to a saparate issue 👍 The user facing behaviour will stay the same, so by default the @ghost user will be deleted :) Once again, thanks for your contribution and increasing test coverage 🚀 FYI: Integration tests are not executed on forked PR but I've checked it locally and all green 👍 |
Description
Add ignore case for user
@ghost
https://git.luolix.topmunity/t5/How-to-use-Git-and-GitHub/CODEOWNERS-file-with-a-NOT-file-type-condition/m-p/31013/highlight/true#M8523Related issue(s)
Fixes #52