Update merge-main-into-prs.yml (#12922)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher authored and GitHub committed 2024-04-14 07:36:44 -07:00
1 parent 51dc1af6e8
commit cf8b67b7e9
1 file changed
+4 -6
+4 -6
View File
@@ -45,12 +45,10 @@ jobs:
for pr in open_pulls: for pr in open_pulls:
# Compare PR head with main to see if it's behind # Compare PR head with main to see if it's behind
try: try:
comparison = repo.compare(pr.base.ref, pr.head.ref) # Ensure correct order of base and head # Merge main into the PR branch
if comparison.behind_by > 0: success = pr.update_branch()
# Merge main into the PR branch assert success, "Branch update failed"
success = pr.update_branch() print(f"Merged 'master' into PR #{pr.number} ({pr.head.ref}) successfully.")
assert success, "Branch update failed"
print(f"Merged 'master' into PR #{pr.number} ({pr.head.ref}) successfully.")
except Exception as e: except Exception as e:
print(f"Could not merge 'master' into PR #{pr.number} ({pr.head.ref}): {e}") print(f"Could not merge 'master' into PR #{pr.number} ({pr.head.ref}): {e}")
env: env: