Skip to content

Commit 507b5ed

Browse files
committed
fixup! Add users option to both GitHub and Gitea restricting project owners
Signed-off-by: magic_rb <richard@brezak.sk>
1 parent 30abfe1 commit 507b5ed

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

buildbot_nix/buildbot_nix/common.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,16 @@ def filter_repos(
123123
user: Callable[[Y], str],
124124
topics: Callable[[Y], list[str]],
125125
) -> list[Y]:
126+
# This is a bit complicated so let me explain:
127+
# If both `user_allowlist` and `repo_allowlist` are `None` then we want to allow everything,
128+
# however if either are non-`None`, then the one that is non-`None` determines whether to
129+
# allow a repo, or both if both are non-+None`.
130+
126131
return list(
127132
filter(
128133
lambda repo: (user_allowlist is None and repo_allowlist is None)
129-
or (user_allowlist is None or user(repo) in user_allowlist)
130-
or (repo_allowlist is None or repo_name(repo) in repo_allowlist),
134+
or (user_allowlist is not None and user(repo) in user_allowlist)
135+
or (repo_allowlist is not None and repo_name(repo) in repo_allowlist),
131136
filter(
132137
lambda repo: topic is None or topic in topics(repo),
133138
repos,

0 commit comments

Comments
 (0)