-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
🐛 Problem
Merge conflict markers (<<<<<<<, =======, >>>>>>>) were accidentally committed to the repository in README.md, which should have been caught by CI before merging.
Example:
<<<<<<< HEAD
# Sync with Translation.io (extract + compile)
=======
# Sync with Translation.io (requires TRANSLATION_IO_API_KEY in .env.local)
>>>>>>> origin/mainThis indicates our CI pipeline is missing a check to prevent such issues from reaching the main branch.
🎯 Proposed Solution
Add a CI check that scans all files for merge conflict markers before allowing a PR to be merged.
Implementation Options
Option 1: Add to preflight.sh script
# Check for merge conflict markers
if git grep -n -E "^(<<<<<<<|=======|>>>>>>>)" -- ':!*.md' ':!docs/**'; then
echo "❌ Merge conflict markers found!"
exit 1
fiOption 2: Add dedicated GitHub Action
name: Check for Merge Conflicts
on:
pull_request:
branches: [main]
jobs:
check-conflicts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for merge conflict markers
run: |
if git grep -n -E '^(<<<<<<<|=======|>>>>>>>)' -- ':!*.md' ':!docs/**'; then
echo "::error::Merge conflict markers found in files"
exit 1
fiOption 3: Pre-commit hook
# In .git/hooks/pre-commit
if git diff --cached | grep -E '^\+.*(<<<<<<<|=======|>>>>>>>)'; then
echo "❌ Merge conflict markers detected!"
exit 1
fi✅ Acceptance Criteria
- CI pipeline detects merge conflict markers in all text files
- Check runs on every PR before merge
- Clear error message indicating which files contain conflicts
- Documented in
CONTRIBUTING.md - Added to
scripts/preflight.shfor local validation - Optional: Add to pre-commit hook setup
📝 Additional Context
This issue was discovered during PR creation for Issue #67 (PWA Phase 3 features). The merge conflict was in README.md line 72-76.
Priority: Medium
Effort: Small (~30 minutes)
Labels: chore, ci, developer-experience
🔗 Related
- Issue Phase 3: Advanced PWA Features #67 (where this was discovered)
- Quality Gates workflow (
.github/workflows/quality.yml) - Preflight script (
scripts/preflight.sh)
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done