You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-32Lines changed: 32 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,13 @@
1
1
# sync-openapi
2
2
3
-
A GitHub Action to sync files/folders from your source repository to a target repository (like fern-config).
3
+
A GitHub Action to sync OpenAPI specifications with your Fern setup. Choose your scenario:
4
+
5
+
-**Case 1: Sync from public URL (most common).** Your OpenAPI spec is hosted at a publicly available URL and you want to pull it into your fern folder
6
+
-**Case 2: Sync between repositories**: Your OpenAPI spec lives in one repository and you want to sync it to another repository where your fern folder lives (like fern-config)
4
7
5
8
## Usage
6
9
7
-
### Case 1: Sync files/folders between repositories
10
+
### Case 1: Sync specs using `fern api update` (recommended)
8
11
9
12
1. In your your source repo, create a file named `sync-openapi.yml` in `.github/workflows/`.
10
13
2. Include the following contents in `sync-openapi.yml`:
@@ -20,32 +23,24 @@ on: # additional custom triggers ca
20
23
- cron: '0 3 * * *'# everyday at 3:00 AM UTC
21
24
22
25
jobs:
23
-
sync:
26
+
update-from-source:
24
27
runs-on: ubuntu-latest
25
28
steps:
26
29
- uses: actions/checkout@v4
27
-
- name: Sync OpenAPI spec to target repo
30
+
with:
31
+
token: ${{ secrets.OPENAPI_SYNC_TOKEN }}
32
+
- name: Update API with Fern
28
33
uses: fern-api/sync-openapi@v2
29
34
with:
30
-
repository: <your-org>/<your-target-repo>
31
-
token: ${{ secrets.<PAT_TOKEN_NAME> }}
32
-
sources: # all paths are relative to source repository root
0 commit comments