Skip to content

Update GitHub Configuration section of generators.yml #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 91 additions & 17 deletions fern/products/sdks/reference/generators-yml-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -674,28 +674,105 @@ groups:

### GitHub Configuration

<ParamField path="groups.{groupName}.generators[].github.repository" type="string" required={true} toc={true}>
Specify how your SDKs are generated in GitHub using the `github` configuration.
Designate the `mode` to specifiy how Fern handles your code changes. For all of the
modes, you must specify the GitHub repository in which you want to store your
SDK code. You can also configure a branch name, license, and reviewers.

<Note>Make sure the [Fern GitHub app](https://github.com/apps/fern-api) is installed on your destination repository</Note>


#### Release (recommended)

Fern generates your code, commits it to main, and tags a new release.

```yml {6-17}
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
...
github:
repository: "your-org/your-repo-name"
mode: "release"
```

<ParamField path="repository" type="string" required={true} toc={true}>
</ParamField>

<ParamField path="mode" type="'release'" required={false} toc={true}>
</ParamField>

<ParamField path="branch" type="string" required={false} toc={true}>
</ParamField>

<ParamField path="license" type="'MIT' | 'Apache-2.0' | { custom: 'Custom License Name' }" required={false} toc={true}>
</ParamField>

<ParamField path="reviewers" type="{ teams: list<string>, users: list<string> }" required={false} toc={true}>
Specify which teams and users should review generated code. See [reviewers configuration](#reviewers-1).
</ParamField>

#### Pull request

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.

```yml {6-8}
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
...
github:
repository: "your-org/your-repo-name"
mode: "pull-request"
```

<ParamField path="repository" type="string" required={true} toc={true}>
</ParamField>

<ParamField path="mode" type="'pull-request'" required={false} toc={true}>
</ParamField>

<ParamField path="branch" type="string" required={false} toc={true}>
</ParamField>

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

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

<ParamField path="groups.{groupName}.generators[].github.license" type="GithubLicenseSchema" required={false} toc={true}>
#### Push

Fern generates your code and pushes it to the branch you specify.

```yml {6-8}
groups:
ts-sdk:
generators:
- name: fernapi/fern-typescript-sdk
...
github:
repository: "your-org/your-repo-name"
mode: "push"
branch: "your-branch-name" # required for `mode: push`
```
<ParamField path="repository" type="string" required={true} toc={true}>
</ParamField>

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

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

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

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

### Generator Metadata
Expand Down Expand Up @@ -741,17 +818,14 @@ reviewers:
- name: "jane-smith"
```

<ParamField path="reviewers" type="ReviewersSchema" required={false} toc={true}>
</ParamField>

<ParamField path="reviewers.teams" type="list<ReviewerSchema>" required={false} toc={true}>
</ParamField>

<ParamField path="reviewers.teams[].name" type="string" required={true} toc={true}>
<ParamField path="teams" type="list<string>" required={false} toc={true}>
GitHub team names that should review generated code.
</ParamField>

<ParamField path="reviewers.users" type="list<ReviewerSchema>" required={false} toc={true}>
<ParamField path="users" type="list<string>" required={false} toc={true}>
GitHub users that should review generated code.
</ParamField>

<ParamField path="reviewers.users[].name" type="string" required={true} toc={true}>
<ParamField path="name" type="string" required={true} toc={true}>
Name of a GitHub team or a user.
</ParamField>