Skip to content

Commit 817c222

Browse files
authored
Update GitHub Configuration section of generators.yml (#175)
1 parent bd0f250 commit 817c222

File tree

1 file changed

+91
-17
lines changed

1 file changed

+91
-17
lines changed

fern/products/sdks/reference/generators-yml-reference.mdx

Lines changed: 91 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -674,28 +674,105 @@ groups:
674674

675675
### GitHub Configuration
676676

677-
<ParamField path="groups.{groupName}.generators[].github.repository" type="string" required={true} toc={true}>
677+
Specify how your SDKs are generated in GitHub using the `github` configuration.
678+
Designate the `mode` to specifiy how Fern handles your code changes. For all of the
679+
modes, you must specify the GitHub repository in which you want to store your
680+
SDK code. You can also configure a branch name, license, and reviewers.
681+
682+
<Note>Make sure the [Fern GitHub app](https://github.com/apps/fern-api) is installed on your destination repository</Note>
683+
684+
685+
#### Release (recommended)
686+
687+
Fern generates your code, commits it to main, and tags a new release.
688+
689+
```yml {6-17}
690+
groups:
691+
ts-sdk:
692+
generators:
693+
- name: fernapi/fern-typescript-sdk
694+
...
695+
github:
696+
repository: "your-org/your-repo-name"
697+
mode: "release"
698+
```
699+
700+
<ParamField path="repository" type="string" required={true} toc={true}>
701+
</ParamField>
702+
703+
<ParamField path="mode" type="'release'" required={false} toc={true}>
704+
</ParamField>
705+
706+
<ParamField path="branch" type="string" required={false} toc={true}>
707+
</ParamField>
708+
709+
<ParamField path="license" type="'MIT' | 'Apache-2.0' | { custom: 'Custom License Name' }" required={false} toc={true}>
710+
</ParamField>
711+
712+
<ParamField path="reviewers" type="{ teams: list<string>, users: list<string> }" required={false} toc={true}>
713+
Specify which teams and users should review generated code. See [reviewers configuration](#reviewers-1).
714+
</ParamField>
715+
716+
#### Pull request
717+
718+
Fern generates your code, commits to a new branch, and opens a PR for review. To publish, you must merge the PR and tag a GitHub release.
719+
720+
```yml {6-8}
721+
groups:
722+
ts-sdk:
723+
generators:
724+
- name: fernapi/fern-typescript-sdk
725+
...
726+
github:
727+
repository: "your-org/your-repo-name"
728+
mode: "pull-request"
729+
```
730+
731+
<ParamField path="repository" type="string" required={true} toc={true}>
732+
</ParamField>
733+
734+
<ParamField path="mode" type="'pull-request'" required={false} toc={true}>
735+
</ParamField>
736+
737+
<ParamField path="branch" type="string" required={false} toc={true}>
678738
</ParamField>
679739

680-
<ParamField path="groups.{groupName}.generators[].github.mode" type="'commit' | 'release' | 'pull-request' | 'push'" required={false} toc={true}>
740+
<ParamField path="license" type="'MIT' | 'Apache-2.0' | { custom: 'Custom License Name' }" required={false} toc={true}>
681741
</ParamField>
682742

683-
<ParamField path="groups.{groupName}.generators[].github.branch" type="string" required={false} toc={true}>
743+
<ParamField path="reviewers" type="{ teams: list<string>, users: list<string> }" required={false} toc={true}>
744+
Specify which teams and users should review generated code. See [reviewers configuration](#reviewers-1).
684745
</ParamField>
685746

686-
<ParamField path="groups.{groupName}.generators[].github.license" type="GithubLicenseSchema" required={false} toc={true}>
747+
#### Push
748+
749+
Fern generates your code and pushes it to the branch you specify.
750+
751+
```yml {6-8}
752+
groups:
753+
ts-sdk:
754+
generators:
755+
- name: fernapi/fern-typescript-sdk
756+
...
757+
github:
758+
repository: "your-org/your-repo-name"
759+
mode: "push"
760+
branch: "your-branch-name" # required for `mode: push`
761+
```
762+
<ParamField path="repository" type="string" required={true} toc={true}>
687763
</ParamField>
688764

689-
<ParamField path="groups.{groupName}.generators[].github.license.MIT" type="'MIT'" required={false} toc={true}>
765+
<ParamField path="mode" type="'push'" required={false} toc={true}>
690766
</ParamField>
691767

692-
<ParamField path="groups.{groupName}.generators[].github.license.Apache" type="'Apache-2.0'" required={false} toc={true}>
768+
<ParamField path="branch" type="string" required={true} toc={true}>
693769
</ParamField>
694770

695-
<ParamField path="groups.{groupName}.generators[].github.license.custom" type="string" required={false} toc={true}>
771+
<ParamField path="license" type="'MIT' | 'Apache-2.0' | { custom: 'Custom License Name' }" required={false} toc={true}>
696772
</ParamField>
697773

698-
<ParamField path="groups.{groupName}.generators[].github.reviewers" type="ReviewersSchema" required={false} toc={true}>
774+
<ParamField path="reviewers" type="{ teams: list<string>, users: list<string> }" required={false} toc={true}>
775+
Specify which teams and users should review generated code. See [reviewers configuration](#reviewers-1).
699776
</ParamField>
700777

701778
### Generator Metadata
@@ -741,17 +818,14 @@ reviewers:
741818
- name: "jane-smith"
742819
```
743820
744-
<ParamField path="reviewers" type="ReviewersSchema" required={false} toc={true}>
745-
</ParamField>
746-
747-
<ParamField path="reviewers.teams" type="list<ReviewerSchema>" required={false} toc={true}>
748-
</ParamField>
749-
750-
<ParamField path="reviewers.teams[].name" type="string" required={true} toc={true}>
821+
<ParamField path="teams" type="list<string>" required={false} toc={true}>
822+
GitHub team names that should review generated code.
751823
</ParamField>
752824
753-
<ParamField path="reviewers.users" type="list<ReviewerSchema>" required={false} toc={true}>
825+
<ParamField path="users" type="list<string>" required={false} toc={true}>
826+
GitHub users that should review generated code.
754827
</ParamField>
755828
756-
<ParamField path="reviewers.users[].name" type="string" required={true} toc={true}>
829+
<ParamField path="name" type="string" required={true} toc={true}>
830+
Name of a GitHub team or a user.
757831
</ParamField>

0 commit comments

Comments
 (0)