As a part of https://github.com/mszostok/codeowners-validator/issues/52 issue, there was an interesting problem regarding the @ghost user which was solved by https://github.com/mszostok/codeowners-validator/pull/53. This issue is about making implemented logic a little more generic and instead of hard-coding the @ghost username, 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.
Reasons
It's always better to have customizable logic in the library which is used by the broader community, so we can handle more custom scenarios :)
TODO
Add IgnoreOwners []string `envconfig:"default=@ghost"` property in line 15 in file internal/check/valid_owner.go. In this way, this property can be automatically set by environment variable OWNER_CHECKER_IGNORE_OWNERS which can be populated with a 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 func shouldIgnoreGitHubOwner(name) which can be used in for _, ownerName := range entry.Owners loop in line 63:
if v.shouldIgnoreGitHubOwner(ownerName) {
continue
}
Update README.md and describe a new environment variable OWNER_CHECKER_IGNORE_OWNERS which can be used
Description
As a part of https://github.com/mszostok/codeowners-validator/issues/52 issue, there was an interesting problem regarding the @ghost user which was solved by https://github.com/mszostok/codeowners-validator/pull/53. This issue is about making implemented logic a little more generic and instead of hard-coding the @ghost username, 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.
Reasons
It's always better to have customizable logic in the library which is used by the broader community, so we can handle more custom scenarios :)
TODO
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 a 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:Update README.md and describe a new environment variable
OWNER_CHECKER_IGNORE_OWNERS
which can be usedUpdate
action.yml
with new property