|
1 | | -# sync-openapi |
| 1 | +<br/> |
| 2 | +<div align="center"> |
| 3 | + <a href="https://www.buildwithfern.com/?utm_source=github&utm_medium=readme&utm_campaign=sync-openapi&utm_content=logo"> |
| 4 | + <picture> |
| 5 | + <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fern-api/fern/main/fern/images/logo-white.svg"> |
| 6 | + <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/fern-api/fern/main/fern/images/logo-primary.svg"> |
| 7 | + <img alt="logo" src="https://raw.githubusercontent.com/fern-api/fern/main/fern/images/logo-primary.svg" height="80" align="center"> |
| 8 | + </picture> |
| 9 | + </a> |
| 10 | +<br/> |
2 | 11 |
|
3 | | -A GitHub Action to [sync OpenAPI specifications with your Fern setup](/learn/api-definitions/openapi/sync-your-open-api-specification). Choose your scenario: |
| 12 | +<br/> |
4 | 13 |
|
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. The GitHub Action uses `fern api update` to pull the latest version of your OpenAPI spec from the `origin` field in your `generators.yml` file. |
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). The GitHub Action uses explicit file mappings to pull the latest version of your OpenAPI spec. |
| 14 | +[](https://github.com/marketplace/actions/sync-openapi) |
| 15 | + |
| 16 | +[](https://buildwithfern.com/learn/api-definitions/openapi/sync-your-open-api-specification?utm_source=fern-api/sync-openapi/readme-read-our-documentation) |
| 17 | + |
| 18 | +</div> |
| 19 | + |
| 20 | +# 🌿 sync-openapi |
| 21 | + |
| 22 | +A GitHub Action to [sync OpenAPI specifications with your Fern setup](https://buildwithfern.com/learn/api-definitions/openapi/sync-your-open-api-specification). Choose your scenario: |
| 23 | + |
| 24 | +- **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. The GitHub Action uses `fern api update` to pull the latest version of your OpenAPI spec from the `origin` field in your `generators.yml` file. |
| 25 | +- **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). The GitHub Action uses explicit file mappings to pull the latest version of your OpenAPI spec. |
7 | 26 |
|
8 | 27 | ## Usage |
9 | 28 |
|
@@ -112,14 +131,15 @@ The GitHub token used for this action must have: |
112 | 131 |
|
113 | 132 | ## Releasing |
114 | 133 |
|
115 | | -This project uses GitHub Releases to publish new versions. When a release is published, a workflow automatically updates the major and minor version tags so consumers stay up to date. |
| 134 | +Tag the commit and publish a GitHub Release: |
| 135 | + |
| 136 | +```sh |
| 137 | +git tag v4.0.1 |
| 138 | +git push origin v4.0.1 |
| 139 | +gh release create v4.0.1 --generate-notes |
| 140 | +``` |
116 | 141 |
|
117 | | -For example, publishing release `v4.1.0` will: |
118 | | -- Force-update the `v4` tag (so `@v4` users get the update) |
119 | | -- Force-update the `v4.1` tag (so `@v4.1` users get the update) |
| 142 | +The [release workflow](.github/workflows/release.yml) automatically moves the major and minor version tags (e.g. `v4` and `v4.0`) to the new release so users pinned to `@v4` or `@v4.0` get the update immediately. |
120 | 143 |
|
121 | | -To release: |
122 | | -1. Go to [Releases → Draft a new release](../../releases/new) |
123 | | -2. Create a new tag (e.g., `v4.0.1`) following [semver](https://semver.org/) |
124 | | -3. Click **Publish release** |
| 144 | +--- |
125 | 145 |
|
0 commit comments