Skip to content

Commit

Permalink
modified: src/automerge.py
Browse files Browse the repository at this point in the history
- Checking the 'chech' statuses per commit
- Ccombined commit was not
  always accurate to the mergeable state of  a PR due to annotations and
other items checked not important to basic check passed? Approved? Up to
datae? Yes? Merge.
  • Loading branch information
F-WRunTime committed Nov 28, 2024
1 parent 3f63d9d commit 801d63e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/automerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ def run_git_command(command_args: str) -> subprocess.CompletedProcess:
base_branch = repo.get_branch(pr.base.ref)
if base_branch.protected:
commit = pr.get_commits().reversed[0]
combined_status = commit.get_combined_status()
all_checks_passed = combined_status.state == 'success'
statuses = commit.get_statuses()
all_checks_passed = all(print(status) for status in statuses)
list_statuses = [status.state for status in statuses]

if not all_checks_passed:
_LOGGER.info(f"Checks are not passing ({combined_status.state}) on PR#{pr.number}")
_LOGGER.info(f"Checks are not passing ({list_statuses[-1]}) on PR#{pr.number}")
commit = [c for c in pr.get_commits() if c.sha == pr.head.sha][0]
combined_status = commit.get_combined_status().state
if pr.mergeable_state == 'clean' and all_checks_passed:
Expand Down

0 comments on commit 801d63e

Please sign in to comment.