Skip to content

Repobot - File Sync

GitHub App

Repobot - File Sync

GitHub App

File Sync

One-way file synchronization for your repositories that supports templates and customizing file names via configuration. You can use it to keep multiple repositories up-to-date with one or more central template repositories where common files are stored.

Setup

File Sync is based on two concepts:

  • Sync repo - a repository where source files and source templates are located
  • Target repo - a repository that syncs files from one or more sync repos based on configuration

⚠️ Currently File Sync app pushes directly to main branch. Support for opening Pull Requests will be added soon.

Configuration files

There are two types of configuration files:

  • .repobot.yml - required file that lists which sync repos should be used and which files should be synced
  • project.yml - additional configuration and data that you can provide for file template rendering

Making a repo a sync repo

To set up your repository as the sync repo, create project.yml file with the following content:

sync_source: true

Configuring file syncing

To configure how files should be synced, create .repobot.yml file in the root of your repo. Here's a basic example:

sources:
  - repo: my-org/my-source-repo
    sync:
      - ".github/FUNDING.yml"
      - "CODE_OF_CONDUCT.md"
      - "LICENSE.md"

In this example, we configure a single source repo and set it to synchronize specified files.

Using templates

You can use file templates in your sync repos, at the moment erb and liquid templates are support.

Here's an example config that uses templates:

sources:
  - repo: my-org/my-source-repo
    sync:
      - ".github/FUNDING.yml.erb"
      - "CODE_OF_CONDUCT.md"
      - "LICENSE.md"

Here we set that .github/FUNDING.yml.erb will be rendered as an ERB template. Inside this template you have access to anything that you set in project.yml as well as everything that GitHub exposes via its repository resources API.

More complex syncing

It's also possible to rename templates and re-use original paths and file names too. For an example of such advanced syncing see dry-rb/dry-logger's .repobot.yml configuration file.

Help & Support

Repobot's File Sync is currently in closed beta and it's free for Open Source organizations on GitHub. If you have any feedback feel free to get in touch.

If you find this app helpful, consider becoming my sponsor on GitHub.

Developer

Repobot - File Sync is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

Report abuse