Currently, if you will pass GitHub token, it won't be validated. If it lacks necessary scopes, a misleading error can be returned. For example:
==> Executing Valid Owner Checker (184.722866ms)
[err] line 8: User "@mszostok" is not a member of the organization
[err] line 11: HTTP error occurred while calling GitHub: GET https://api.github.com/orgs/GitHubCODEOWNERS/teams?per_page=100: 403 Must have admin rights to Repository. []
but in real, the problem is that the token doesn't have the "read:org" scope.
To avoid such problems, we need to check if token has the "read:org" and "public_repo" scopes when owners check is enabled.
Description
Currently, if you will pass GitHub token, it won't be validated. If it lacks necessary scopes, a misleading error can be returned. For example:
but in real, the problem is that the token doesn't have the "read:org" scope.
To avoid such problems, we need to check if token has the "read:org" and "public_repo" scopes when
owners
check is enabled.