Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update merge-main-into-prs.yml #12921

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading