Add fern generate composite action#10
Conversation
The CLI's automations list generate emits commands prefixed with "fern " (e.g. "fern automations generate --api bar ..."), but the action already invokes fern via fern-cmd (npx fern-api@latest). Without stripping, eval produces "npx fern-api@latest fern automations generate ...", which yargs rejects as an unknown command and falls back to printing help — silently, since help exits 0.
| @@ -0,0 +1,22 @@ | |||
| name: Verify Fern Token | |||
There was a problem hiding this comment.
🔴 Missing README.md for new verify-token composite action (CONTRIBUTING.md violation)
CONTRIBUTING.md states that composite actions must include both action.yml and README.md (under "Adding a new action → Composite action"). The new verify-token action only contains action.yml. All other composite actions in the repo (resolve-cli, setup-cli, sync-openapi) follow this convention and include a README.md.
Was this helpful? React with 👍 or 👎 to provide feedback.
| runs: | ||
| using: "node20" | ||
| main: "dist/index.js" | ||
| using: composite |
There was a problem hiding this comment.
🟡 Missing README.md required by CONTRIBUTING.md for composite actions
CONTRIBUTING.md §"Composite action" (CONTRIBUTING.md:65) states: "Create actions/<your-action>/action.yml and actions/<your-action>/README.md." The PR converts actions/generate from a Node.js action to a composite action but does not add a README.md. Both other composite actions in the repo (actions/setup-cli/ and actions/resolve-cli/) include a README.md, making this an inconsistency with the stated guidelines and existing conventions.
Prompt for agents
The CONTRIBUTING.md requires composite actions to have both an action.yml and a README.md. The PR converts actions/generate from a Node.js action to a composite action but does not include a README.md. Add an actions/generate/README.md describing the action, its inputs, outputs, and usage examples. You can use actions/setup-cli/README.md or actions/resolve-cli/README.md as a template.
Was this helpful? React with 👍 or 👎 to provide feedback.
| uses: fern-api/actions/actions/verify-token@niels/generate | ||
| with: | ||
| fern-token: ${{ inputs.fern-token }} | ||
|
|
||
| - name: Resolve Fern CLI | ||
| id: cli | ||
| uses: fern-api/actions/actions/resolve-cli@niels/generate |
There was a problem hiding this comment.
🔴 generate/action.yml references @niels/generate branch instead of @main, will break after merge
The new generate/action.yml references internal composite actions at fern-api/actions/verify-token@niels/generate (line 31) and fern-api/actions/resolve-cli@niels/generate (line 37). niels/generate is the current PR branch. Once this PR merges to main, this branch will typically be deleted, causing the generate action to fail at runtime for all consumers. Even if the branch survives, it will never receive future updates to verify-token or resolve-cli. The established pattern (see sync-openapi/action.yml:36) is to pin to @main.
Was this helpful? React with 👍 or 👎 to provide feedback.
Moves actions/* to top level so customer uses: URLs read fern-api/actions/<name>@<ref> instead of fern-api/actions/actions/<name>@<ref>. Updates pnpm workspace, CI glob, tsconfigs, README, CONTRIBUTING, and composite self-refs in generate/action.yml to match.
Summary
fern automations list generate, and runs each one (or emits them for matrix fan-out via thecommandsoutput).fern-token,auto-merge(defaulttrue),group,version(defaultAUTO),dry-run.fern/apis/{foo,bar}fixtures.Test plan
Test generateworkflow passes on this PR (dry-run discovers ≥1 command)workflow_dispatchwithdry-run: falseruns each discovered generator end-to-endcommandsoutput is valid JSON usable withfromJson()for matrix fan-out--groupfilter narrows the discovered command list🤖 Generated with Claude Code