Skip to content

Commit d01bba4

Browse files
authored
Update README.md [skip ci]
1 parent 338516b commit d01bba4

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# sync-openapi
22

3-
A GitHub Action to sync files from your source repository to a target repository (like fern-config).
3+
A GitHub Action to sync files/folders from your source repository to a target repository (like fern-config).
44

55
## Usage
66

77
1. In your your source repo, create a file named `sync-openapi.yml` in `.github/workflows/`.
8-
2. Include the following contents in the `sync-openapi.yml` you just created:
8+
2. Include the following contents in `sync-openapi.yml`:
99

1010
```yaml
1111
name: Sync OpenAPI Specs # can be customized
@@ -24,16 +24,19 @@ jobs:
2424
with:
2525
repository: <your-org>/<your-target-repo>
2626
token: ${{ secrets.<PAT_TOKEN_NAME> }}
27-
files: |
28-
- source: path/to/file1/in/this/repo.yml # note: all file paths are relative to repository root
29-
destination: path/to/file1/in/destination/repo.yml
30-
- source: path/to/file2/in/this/repo.yml
31-
destination: path/to/file2/in/destination/repo.yml
32-
27+
sources: # all paths are relative to source repository root
28+
- from: path/to/source/dir # supports folder syncing
29+
to: path/to/target/dir
30+
exclude: # optional
31+
- path/to/file/to/exclude.yaml # supports individual file exclusion
32+
- path/to/dir/to/exclude/** # supports glob-based pattern matching
33+
- path/to/files/*_test.yaml
34+
- from: path/to/source/file.yaml # supports individual file syncing
35+
to: path/to/target/file.yaml
3336
....
3437

3538
branch: main
36-
auto_merge: true # note: branch = main with auto_merge = false will cause an error
39+
auto_merge: true # you MUST use auto_merge: true with branch: main
3740

3841
```
3942

@@ -42,11 +45,12 @@ jobs:
4245
| Input | Description | Required | Default |
4346
|-------|-------------|----------|---------|
4447
| `repository` | Target repository in format `org/repo` | Yes | - |
45-
| `files` | Array of mappings with source and destination paths | Yes | - |
48+
| `sources` | Array of mappings with from, to, and (optional) exclude fields | Yes | - |
4649
| `token` | GitHub token for authentication | No | `${{ github.token }}` |
4750
| `branch` | Branch to push to in the target repository | Yes | - |
4851
| `auto_merge` | Will push directly to the specified branch when `true`, will create a PR from the specified base branch onto main if `false`. | No | `false` |
4952

53+
**Note: you must set `auto_merge: true` when using `branch: main`**
5054

5155
## Required Permissions
5256

0 commit comments

Comments
 (0)