print(f"⚠️ PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}) is behind {default_branch_name} by {comparison.behind_by} commit(s).")
print(f"⚠️ PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}) is behind {default_branch_name} by {comparison.behind_by} commit(s).")
@ -58,13 +63,23 @@ jobs:
success = pr.update_branch()
success = pr.update_branch()
assert success, "Branch update failed"
assert success, "Branch update failed"
print(f"✅ Successfully merged '{default_branch_name}' into PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}).")
print(f"✅ Successfully merged '{default_branch_name}' into PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}).")
updated_branches += 1
time.sleep(10) # rate limit merges
except Exception as update_error:
except Exception as update_error:
print(f"❌ Could not update PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}): {update_error}")
print(f"❌ Could not update PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}): {update_error}")
print(" This might be due to branch protection rules or insufficient permissions.")
errors += 1
else:
else:
print(f"✅ PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}) is up to date with {default_branch_name}.")
print(f"✅ PR#{pr.number} ({head_repo_name}:{head_branch_name} -> {base_repo_name}:{base_branch_name}) is already up to date with {default_branch_name}, no merge required.")