ci: add PR overlap detection workflow

Automatically detects potential merge conflicts between open PRs:

- Triggered on PR open/push to dev or master
- Compares changed files and line ranges across open PRs
- Tests actual merge conflicts by attempting merges
- Posts a comment on the PR with:
  - 🔴 Confirmed merge conflicts (with file paths and conflict sizes)
  - 🟠 High risk overlaps (>20 lines overlap)
  - 🟡 Medium risk overlaps
  - 🟢 Low risk (file overlap only)
- Shows conflict types (content, added, deleted, etc.)
- Includes last-updated timestamps for each PR

This helps contributors coordinate and resolve conflicts proactively.
This commit is contained in:
Otto
2026-02-13 12:51:18 +00:00
parent e8fc8ee623
commit 6647c6615b
2 changed files with 968 additions and 0 deletions

37
.github/workflows/pr-overlap-check.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: PR Overlap Detection
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- dev
- master
permissions:
contents: read
pull-requests: write
jobs:
check-overlaps:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Need full history for merge testing
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Configure git
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Run overlap detection
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python .github/scripts/detect_overlaps.py ${{ github.event.pull_request.number }}