Docs
Sync Tasks

Sync Tasks

Sync Tasks are the core orchestration units in Repo File Sync that automate the synchronization of files and directories between repositories. Think of a Sync Task as a container that holds one or more [Sync Rules](/docs/sync-rules) and executes them together to create pull requests in your target repositories.

What is a Sync Task?

A Sync Task is a named collection of synchronization rules that can be executed manually or on a schedule. When a Sync Task runs, it:

  1. Processes all configured Sync Rules - Each rule defines which files to sync from a source repository to a target repository
  2. Creates Pull Requests - Automatically generates PRs in target repositories with the synchronized changes
  3. Tracks Results - Records execution history, file statistics, and PR details for monitoring and auditing

Key Features

📋 Task Organization

  • Name and Description: Give your tasks meaningful names and descriptions for easy identification
  • Multiple Rules: Each task can contain multiple sync rules, allowing complex synchronization workflows
  • Execution History: View detailed logs of when tasks ran, what changed, and any errors that occurred

Execution Modes

  • Manual Execution: Run tasks on-demand through the dashboard
  • Scheduled Execution: Set up automatic runs using cron expressions (coming soon)
  • Webhook Triggers: Trigger tasks automatically when source repositories change (coming soon)

📊 Monitoring and Results

  • Real-time Status: See when tasks are running, completed, or failed
  • File Statistics: Track how many files were added, modified, or deleted
  • Pull Request Links: Direct links to created PRs for easy review and merging

Creating a Sync Task

Step 1: Basic Information

  1. Navigate to your organization dashboard
  2. Click "Create Sync Task"
  3. Enter a descriptive name (e.g., "Sync Documentation", "Update Shared Components")
  4. Add an optional description explaining the task's purpose

Step 2: Configure Sync Rules

After creating the task, you'll need to add at least one Sync Rule:

  1. Click "Add Rule" to create your first sync rule
  2. Configure the source repository and path
  3. Set the target repository and path
  4. Choose pattern matching type (Exact or Glob)
  5. Configure advanced options like overwrite behavior and file patterns

Step 3: Test and Execute

  1. Save your configuration
  2. Run manually to test the synchronization
  3. Review the results and created pull requests
  4. Refine rules as needed based on the results

Best Practices

🎯 Task Organization

  • Single Purpose: Create tasks with a clear, single purpose (e.g., "Documentation Sync", "Component Library Updates")
  • Logical Grouping: Group related sync rules together in the same task
  • Descriptive Names: Use names that clearly indicate what the task does and which repositories it affects

🔧 Configuration

  • Start Simple: Begin with one or two rules, then add complexity as needed
  • Test First: Always run tasks manually before setting up automation
  • Monitor Results: Regularly check execution history and PR outcomes

🚨 Error Handling

  • Review Failures: Check execution logs when tasks fail
  • Fix Conflicts: Resolve merge conflicts in created PRs promptly
  • Update Rules: Modify rules when repository structures change

Common Use Cases

Documentation Synchronization

Keep documentation consistent across multiple repositories:

Task: "Documentation Sync"
├── Rule 1: README.md from main-repo → all service repos
├── Rule 2: docs/api/* from api-repo → documentation-site
└── Rule 3: CONTRIBUTING.md from main-repo → all repos

Shared Component Updates

Propagate component library changes:

Task: "Component Library Sync"
├── Rule 1: src/components/** from ui-lib → web-app
├── Rule 2: src/components/** from ui-lib → mobile-app
└── Rule 3: types/components.ts from ui-lib → both apps

Configuration Management

Maintain consistent configuration across environments:

Task: "Config Sync"
├── Rule 1: .github/workflows/** from template → all repos
├── Rule 2: eslint.config.js from standards → all js repos
└── Rule 3: tsconfig.json from standards → all ts repos

Execution Results

When a Sync Task completes, you'll see:

  • Duration: How long the task took to execute
  • Files Processed: Total number of files examined
  • Changes Made: Files added, modified, or deleted
  • Pull Requests: Links to created PRs in target repositories
  • Errors: Any issues encountered during execution

Next Steps

  • Learn about Sync Rules to understand how to configure individual synchronization rules
  • Explore Use Cases for more detailed examples and patterns
  • Check out Integrations to connect with your favorite tools and workflows

Ready to create your first Sync Task? Head to your organization dashboard and click "Create Sync Task" to get started!