Skip to content

Commit

Permalink
Add validation rule for allow_forking of public repos.
Browse files Browse the repository at this point in the history
  • Loading branch information
netomi committed Apr 19, 2023
1 parent 3b018df commit dc44a23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions otterdog/operations/validate_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ def validate(self, organization: org.Organization) -> int:
repo_name = repo["name"]
is_private = repo["private"]

allow_forking = repo.get("allow_forking", True)
if is_private is False and allow_forking is False:
self.printer.print_warn(
f"public repo[name=\"{repo_name}\"] has 'allow_forking' disabled which is not permitted.")
validation_errors += 1

has_wiki = repo.get("has_wiki", False)
if is_private and has_wiki is True:
self.printer.print_warn(
Expand Down

0 comments on commit dc44a23

Please sign in to comment.