Skip to content

Add fern generate composite action#10

Open
fern-support wants to merge 10 commits intomainfrom
niels/generate
Open

Add fern generate composite action#10
fern-support wants to merge 10 commits intomainfrom
niels/generate

Conversation

@fern-support
Copy link
Copy Markdown
Collaborator

@fern-support fern-support commented Apr 17, 2026

Summary

  • New actions/generate composite action that resolves the Fern CLI, discovers generator commands via fern automations list generate, and runs each one (or emits them for matrix fan-out via the commands output).
  • Inputs: fern-token, auto-merge (default true), group, version (default AUTO), dry-run.
  • Test workflow .github/workflows/test-generate.yml runs on PRs and asserts at least one command is discovered against the new fern/apis/{foo,bar} fixtures.

Test plan

  • Test generate workflow passes on this PR (dry-run discovers ≥1 command)
  • Manual workflow_dispatch with dry-run: false runs each discovered generator end-to-end
  • Verify commands output is valid JSON usable with fromJson() for matrix fan-out
  • Confirm --group filter narrows the discovered command list

🤖 Generated with Claude Code


Open with Devin

devin-ai-integration[bot]

This comment was marked as resolved.

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.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 9 additional findings in Devin Review.

Open in Devin Review

Comment thread verify-token/action.yml
@@ -0,0 +1,22 @@
name: Verify Fern Token
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread actions/generate/action.yml Outdated
runs:
using: "node20"
main: "dist/index.js"
using: composite
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 9 additional findings in Devin Review.

Open in Devin Review

Comment thread actions/generate/action.yml Outdated
Comment on lines +37 to +43
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
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

Open in Devin Review

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.
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.

2 participants