Skip to content

Commit

Permalink
Skip forks early in main branch bot
Browse files Browse the repository at this point in the history
Avoid creating useless jobs for forks.
  • Loading branch information
sbidoul committed Dec 16, 2023
1 parent 664cc7b commit c8d582e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions newsfragments/277.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Skip fork repos earlier in main branch bot, for better performance in organisations
with a large number of forks.
2 changes: 2 additions & 0 deletions src/oca_github_bot/tasks/main_branch_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def main_branch_bot(org, repo, branch, build_wheels, dry_run=False):
def main_branch_bot_all_repos(org, build_wheels, dry_run=False):
with github.login() as gh:
for repo in gh.repositories_by(org):
if repo.fork:
continue

Check warning on line 157 in src/oca_github_bot/tasks/main_branch_bot.py

View check run for this annotation

Codecov / codecov/patch

src/oca_github_bot/tasks/main_branch_bot.py#L157

Added line #L157 was not covered by tests
for branch in repo.branches():
if not is_main_branch_bot_branch(branch):
continue
Expand Down

0 comments on commit c8d582e

Please sign in to comment.