This guide migrates an SDK from release or push output mode to pull-request output mode — the mode required to enable Fern Replay. Only follow it if your SDK is currently on release or push mode and you want to switch in order to use Replay. SDKs already using pull-request mode have Replay on by default; no migration is needed.
main.fern upgrade.fern generator upgrade.Fern sets GitHub Actions secrets in your SDK repo on every generation. When you switch to pull-request output mode, that write would clobber any secrets you set directly. To avoid this, move secret ownership from the config repo to the SDK repo before flipping modes.
For each SDK repo:
Find which secrets your generators.yml references for publishing:
PYPI_USERNAME, PYPI_PASSWORDNPM_TOKENMAVEN_USERNAME, MAVEN_PASSWORD, MAVEN_SIGNATURE_KID, MAVEN_SIGNATURE_PASSWORD, MAVEN_SIGNATURE_SECRET_KEYRUBY_GEMS_API_KEYNUGET_API_KEYCRATES_TOKENAdd the real publish credentials directly to the SDK repo: Settings → Secrets and variables → Actions → New repository secret.
In generators.yml:
If you use version: AUTO, no other changes are needed. Autoversioning runs as part of the generator-cli pipeline and diffs pure generator output, so customer customizations never contaminate the version diff.
To control publishing on your own schedule rather than on every Fern generation, keep your publish workflow out of Fern’s generation cycle:
Run fern generate --group <group-name> from the config repo (or trigger via your existing CI).
The first run auto-creates .fern/replay.lock. Replay tracks customer commits to generated files from this point on.
After the first generation and merge, confirm the following:
main)..fern/replay.lock exists in the SDK repo..fernignore contains replay.lock (and replay.yml).After your first real customization, verify Replay’s behavior end-to-end:
main.fern generate detects the patch (PR body shows patches detected: 1)..fern/replay.lock shows the patch stored.Replay never modifies files destructively. Your main branch always has correct code, so rolling back is straightforward.
Quick disable. To stop Replay while staying in pull-request mode, set replay.enabled: false in your generators.yml (see the replay reference). The next fern generate skips the patch detection and application phase; PRs land in the same shape as before, just without the [fern-replay] commit.
Full revert to release or push mode:
git log on every run, so force-pushed branches continue to work and existing patches still apply correctly.