Skip to content

feat(upgrade): implement fern-upgrade GitHub Action as composite#9

Draft
lifanzou wants to merge 2 commits intomainfrom
lifanzou/fern-upgrade-action
Draft

feat(upgrade): implement fern-upgrade GitHub Action as composite#9
lifanzou wants to merge 2 commits intomainfrom
lifanzou/fern-upgrade-action

Conversation

@lifanzou
Copy link
Copy Markdown
Contributor

@lifanzou lifanzou commented Apr 11, 2026

Summary

Implements the fern-upgrade GitHub Action (FER-9674) as a composite action, aligning with the repo's architectural pattern where actions are thin shell wrappers around CLI commands (like sync-openapi, resolve-cli, setup-cli).

  • Runs fern upgrade --yes and fern generator upgrade --yes via the resolved CLI
  • Detects version changes by snapshotting fern.config.json + generators.yml before/after
  • Opens or updates a shared PR on the fern/upgrade branch with changelog links
  • Uses resolve-cli for CLI resolution, gh CLI for PR management, plain JS helper scripts for version diffing

Architecture

actions/upgrade/
  action.yml          # Composite action (7 steps)
  scripts/
    snapshot.js       # Version snapshot capture (plain JS, no npm deps)
    diff.js           # Diff computation + PR title/body generation
  README.md           # Usage docs

No package.json, no dist/ bundle, no TypeScript build — just action.yml + helper scripts.

Stubs

  • FER-9668: telemetry (TODO in action.yml)
  • FER-9669: automation config check (TODO in action.yml)

Test plan

  • snapshot.js tested with single-API and multi-API fixtures
  • diff.js tested with CLI upgrade, generator upgrade, and combined scenarios
  • Biome lint/format passes
  • TypeScript compiles for all remaining workspace packages
  • Pre-commit hooks pass (check + typecheck)
  • Manual end-to-end test in a repo with fern.config.json + generators.yml

🤖 Generated with Claude Code

Implements end-to-end fern-upgrade action that automates Fern CLI and
generator version upgrades. Runs `fern upgrade` and `fern generator
upgrade`, detects changes by diffing config files before/after, and
opens or updates a shared PR on the `fern/upgrade` branch.

- Add version-diff module for parsing fern.config.json and generators.yml
- Add PR management with clean-slate branch strategy (force push)
- Add PR title/body generation with changelog links from FDR
- Add github-token input with default GITHUB_TOKEN fallback
- Add CLI version resolution (auto/latest/inherit/specific)
- Stub telemetry (FER-9668) and automation config (FER-9669) as TODOs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lifanzou lifanzou self-assigned this Apr 11, 2026
Replace the Node.js action (TypeScript + tsup bundle) with a composite
action to align with the repo's architectural pattern where actions are
thin shell wrappers around CLI commands.

- Rewrite action.yml from `using: node20` to `using: composite`
- Add scripts/snapshot.js for version capture (plain JS, no npm deps)
- Add scripts/diff.js for diff computation + PR content generation
- Reuse resolve-cli composite action for CLI version resolution
- Use gh CLI for PR management instead of @actions/github
- Delete all TypeScript source, tests, dist bundle, and build config
- Remove upgrade from pnpm workspace (no package.json needed)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lifanzou lifanzou changed the title feat(upgrade): implement fern-upgrade GitHub Action feat(upgrade): implement fern-upgrade GitHub Action as composite Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant