Skip to content

Commit

Permalink
Update merge-main-into-prs.yml (#12921)
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
glenn-jocher authored Apr 14, 2024
1 parent 6c8f693 commit 51dc1af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/merge-main-into-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
for pr in open_pulls:
# Compare PR head with main to see if it's behind
comparison = repo.compare(pr.base.ref, pr.head.ref) # Ensure correct order of base and head
if comparison.behind_by > 0:
try:
try:
comparison = repo.compare(pr.base.ref, pr.head.ref) # Ensure correct order of base and head
if comparison.behind_by > 0:
# Merge main into the PR branch
success = pr.update_branch()
assert success, "Branch update failed"
print(f"Merged 'master' into PR #{pr.number} ({pr.head.ref}) successfully.")
except Exception as e:
print(f"Could not merge 'master' into PR #{pr.number} ({pr.head.ref}): {e}")
except Exception as e:
print(f"Could not merge 'master' into PR #{pr.number} ({pr.head.ref}): {e}")
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}

0 comments on commit 51dc1af

Please sign in to comment.