Skip to content

Commit

Permalink
Check checks in merge script
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed May 19, 2024
1 parent 7607edd commit daf5475
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/ckan_merge_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ def merge_into(self, repo: CkanRepo, self_review: bool) -> bool:
if not branch:
print(f'PR #{self.pull_request.number} commit {self.pull_request.head.sha} not found!')
return False
pr_commits = self.pull_request.get_commits()
incomplete_checks = [run
for run in pr_commits[pr_commits.totalCount - 1].get_check_runs()
if run.status != 'completed'
or run.conclusion not in ('success', 'skipped')]
if incomplete_checks:
print('Incomplete checks:', ', '.join(ch.name for ch in incomplete_checks))
return False
# Valid; do it!
# repo.index.merge_tree doesn't auto resolve conflicts
repo.git.merge(branch, no_commit=True, no_ff=True)
Expand Down

0 comments on commit daf5475

Please sign in to comment.