Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add permissions check to valid_owner
Previously, the valid_owner check used the Repositories List Teams API endpoint to check if a team was valid. Due to an issue in the GitHub API, that endpoint does not return child teams that would inherit a parent team's permissions. This commit changes the initial check for the validity of a team to use the Teams List Teams API endpoint, which lists all teams in a org to check if the team exists at all. If that check fails, it will clearly state that the team does not exist. As a follow up to the initial valid team check, this commit checks the Teams IsTeamRepoBySlug endpoint, which returns an object containing the actual permissions for the team being checked on the repo. By adding this check, we can verify that a user can actually provide their review on PRs that made the CODEOWNERS line.
- Loading branch information