mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 18:28:15 +00:00
Component sync workflow
This workflow synchronizes components from the main untitleduico/react repository with intelligent commit tracking.
How to use
- Go to the "Actions" tab in your GitHub repository
- Select "Sync Components from Main Repository"
- Click "Run workflow"
- Configure options:
- Directories: Which directories to sync (default:
components,hooks,utils,styles) - Sync mode: Choose between
allorexisting-only
- Directories: Which directories to sync (default:
- Click "Run workflow" to start the sync
What it does
- Fetches the latest commit information from the main repository
- Tracks previously synced commits to show what's new
- Creates a branch named
sync/YYYY-MM-DD-[commit-hash] - Processes files by removing
"use client";directives - Generates a PR with commit history and detailed diff summaries
- Stores the sync state for future runs
Sync modes
all (default)
- Syncs all files from the main repository
- Adds new files and updates existing ones
- Creates complete mirror of main repo structure
existing-only
- Only updates files that already exist in your repository
- Skips new files from the main repository
- Useful for maintaining a subset of components
Smart commit tracking
- First run: Shows "Initial sync" with latest commit details
- Subsequent runs: Shows commit range since last sync
- Up-to-date: Indicates when no new commits are available
- Commit history: Collapsible list of all commits since last sync
Branch naming
Branches follow the pattern: sync/YYYY-MM-DD-[short-commit-hash]
- Example:
sync/2024-03-15-a1b2c3d
PR format
The generated PR includes:
Title
- New commits:
🔄 Sync components (X commits) → a1b2c3d - First sync:
🎉 Initial sync from main repository → a1b2c3d
Content
- Commits since last sync: Collapsible commit history with links
- Changed files: Each file with collapsible diff view
- Sync details: Source repo, latest commit, date, directories synced
- Automated processing: Notes about
"use client"removal
State management
The workflow stores sync state in .github/last-sync-commit to track:
- Last successfully synced commit hash
- Enables incremental sync reporting
- Shows commit ranges in PR descriptions
Requirements
- Repository must have
contents: writeandpull-requests: writepermissions - Uses
GITHUB_TOKEN(automatically available in GitHub Actions) - GitHub CLI (
gh) for PR creation