You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use GitHub App for codeowner validation and remove hacky script
We shouldn't use personal access tokens, instead we created a GitHub App
with read-only access to just this repository.
While codeowners-validator supports GitHub App authentication,
the same cannot be said for the hacky script I wrote because there was no support
for checking write access: mszostok/codeowners-validator#157
Instead of trying to hack the script more to make it work with GitHub App authentication,
I decided to implement it into codeowners-validator itself: mszostok/codeowners-validator#222
Because it's not merged/released yet, we need to build it ourselves,
so I added some Nix to do that reproducibly.
# The repository path in which CODEOWNERS file should be validated."
46
-
repository_path: untrusted-pr
47
-
48
-
# The owner and repository name. For example, gh-codeowners/codeowners-samples. Used to check if GitHub team is in the given organization and has permission to the given repository."
# "The comma-separated list of experimental checks that should be executed. By default, all experimental checks are turned off. Possible values: notowned,avoid-shadowing"
52
-
experimental_checks: "notowned,avoid-shadowing"
53
-
54
-
# Specifies whether CODEOWNERS may have unowned files. For example, `/infra/oncall-rotator/oncall-config.yml` doesn't have owner and this is not reported.
55
-
owner_checker_allow_unowned_patterns: "false"
56
-
57
-
# Specifies whether only teams are allowed as owners of files.
58
-
owner_checker_owners_must_be_teams: "false"
59
-
60
-
# The above validator doesn't currently ensure that people have write access: https://github.com/mszostok/codeowners-validator/issues/157
61
-
# So we're doing it manually instead
62
-
- name: Check that codeowners have write access
63
-
# Important that we run the script from the base branch,
64
-
# because otherwise a PR from a fork could change it to extract the secret
0 commit comments