https://github.com/netlify/file-sync-action
A GitHub Action for syncing files across repositories
https://github.com/netlify/file-sync-action
Last synced: 2 months ago
JSON representation
A GitHub Action for syncing files across repositories
- Host: GitHub
- URL: https://github.com/netlify/file-sync-action
- Owner: netlify
- License: mit
- Created: 2022-03-12T19:29:27.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-23T10:01:54.000Z (6 months ago)
- Last Synced: 2025-06-23T11:20:22.011Z (6 months ago)
- Language: JavaScript
- Size: 900 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# File Sync Action
A GitHub Action for syncing files across repositories.
## The basics
This GitHub Action allows you to hold a file in a central repository and propagate it to other repositories automatically on every update. When the file changes in the source repository, File Sync Action will create a pull request on each configured mirror to propagate the update.
## Configuration
The action supports the following inputs:
| Name | Description | Default |
| ------------- | ------------------------------------------ | -------------------- |
| `files` | A JSON string containing the file mapping | `{}` |
| `token` | GitHub access token | |
The `files` input is a JSON string containing a mapping of remote files to local paths in your repository.
For example, if you'd like the file `from.md` in the `netlify/foobar` repository to map to the `to.md` path in your repository, the `files` should be:
```
{"netlify/foobar#from.md": "to.md"}
```
## Usage
Add the File Sync Action to a GitHub workflow:
```yaml
on:
schedule:
- cron: '* * * * *'
jobs:
sync_files:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: File Sync
uses: netlify/file-sync-action@v1
with:
files: '{"netlify/foobar#from.md": "to.md"}'
token: ${{ secrets.GITHUB_TOKEN }}
```
## Contributors
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on how to set up and work on this repository. Thanks
for contributing!