You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: actions/generate/action.yml
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ description: "[ALPHA] Runs fern generate on push to main and opens SDK PRs in SD
3
3
author: "Fern"
4
4
5
5
inputs:
6
+
version:
7
+
description: "Fern CLI version to use. 'auto' respects fern.config.json and falls back to latest, 'latest' always uses the newest release, 'inherit' uses the bootstrapped binary as-is, or pin to a specific version (e.g. '0.15.0')."
8
+
required: false
9
+
default: "auto"
6
10
fern-token:
7
11
description: "Fern token for API access and SDK repo PR creation"
A shared composite action that resolves the Fern CLI command based on a requested version. Used internally by other Fern actions to centralize CLI version resolution logic.
4
+
5
+
## Inputs
6
+
7
+
| Input | Description | Default |
8
+
|-------|-------------|---------|
9
+
|`version`|`auto` respects `fern.config.json`, `latest` uses the newest release, `inherit` uses whatever CLI is on PATH, or a specific version/npm tag (e.g. `0.15.0`, `beta`). |`auto`|
10
+
11
+
## Outputs
12
+
13
+
| Output | Description |
14
+
|--------|-------------|
15
+
|`fern-cmd`| The resolved command to invoke the Fern CLI (e.g. `npx --yes fern-api@latest` or `fern`). |
16
+
17
+
## Usage
18
+
19
+
```yaml
20
+
steps:
21
+
- uses: fern-api/actions/resolve-cli@main
22
+
id: cli
23
+
with:
24
+
version: "latest"
25
+
26
+
- run: ${{ steps.cli.outputs.fern-cmd }} generate
27
+
```
28
+
29
+
## Version resolution
30
+
31
+
| `version` value | Behavior |
32
+
|-----------------|----------|
33
+
| `auto` | Installs latest via `npx`, lets the CLI resolve from `fern.config.json` at runtime. |
34
+
| `latest` | Installs latest via `npx` with `FERN_NO_VERSION_REDIRECTION=true`. |
35
+
| `inherit` | Uses bare `fern` from PATH with `FERN_NO_VERSION_REDIRECTION=true`. Fails if `fern` is not found. |
36
+
| `0.15.0` / `beta` / any tag | Installs that version via `npx` with `FERN_NO_VERSION_REDIRECTION=true`. |
description: "Resolves the Fern CLI command based on the requested version. Outputs a fern-cmd string to use in subsequent steps."
3
+
author: "Fern"
4
+
5
+
inputs:
6
+
version:
7
+
description: "Fern CLI version to use. 'auto' respects fern.config.json and falls back to latest, 'latest' always uses the newest release, 'inherit' uses whatever CLI is already on PATH, or pin to a specific version or npm tag (e.g. '0.15.0', 'beta')."
8
+
required: false
9
+
default: "auto"
10
+
11
+
outputs:
12
+
fern-cmd:
13
+
description: "The resolved fern command to use in subsequent steps."
Copy file name to clipboardExpand all lines: actions/setup-cli/action.yml
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
name: Setup Fern CLI
2
-
description: "Install the Fern CLI in your GitHub Actions workflow. Requires Node.js and npm — add actions/setup-node before this step if your runner doesn't include them."
2
+
description: "Install the Fern CLI globally in your GitHub Actions workflow. Requires Node.js and npm — add actions/setup-node before this step if your runner doesn't include them."
3
3
author: "Fern"
4
4
5
5
branding:
@@ -8,7 +8,7 @@ branding:
8
8
9
9
inputs:
10
10
version:
11
-
description: "Fern CLI version to install. Use 'latest' to always get the newest release, or pin to a specific version (e.g. '0.15.0') for reproducible builds."
11
+
description: "Fern CLI version to install globally. Use 'latest' to get the newest release, or pin to a specific version or npm tag (e.g. '0.15.0', 'beta')."
12
12
required: false
13
13
default: "latest"
14
14
@@ -39,11 +39,11 @@ runs:
39
39
VERSION: ${{ inputs.version }}
40
40
run: |
41
41
if ! command -v npm &>/dev/null; then
42
-
echo "Error: npm is not available. Please add a Node.js setup step before this action."
42
+
echo "::error::npm is not available. Please add a Node.js setup step before this action."
43
43
exit 1
44
44
fi
45
45
if ! command -v node &>/dev/null; then
46
-
echo "Error: node is not available. Please add a Node.js setup step before this action."
46
+
echo "::error::node is not available. Please add a Node.js setup step before this action."
Copy file name to clipboardExpand all lines: actions/sync-openapi/action.yml
+48-6Lines changed: 48 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,15 @@ description: "Keep your Fern config up to date — pull OpenAPI specs from a URL
3
3
author: "Fern"
4
4
5
5
inputs:
6
+
version:
7
+
description: "Fern CLI version to use. Use 'latest' to always get the newest release, a specific version (e.g. '0.15.0') for reproducible builds, or 'inherit' to use whatever CLI is already installed."
8
+
required: false
9
+
default: "latest"
6
10
token:
7
11
description: "GitHub token with contents: write and pull-requests: write on the target repository."
8
12
required: true
9
13
update_from_source:
10
-
description: "Set to 'true' to run 'fern api update' and pull the latest spec from the URL configured in generators.yml. Use this for Case 1 (public URL). Set to 'false' to sync files between repositories (Case 2)."
14
+
description: "Set to 'true' to run 'fern api pull' and fetch the latest spec from the URL configured in generators.yml. Set to 'false' to sync files between repositories."
11
15
required: false
12
16
default: "false"
13
17
repository:
@@ -17,17 +21,55 @@ inputs:
17
21
description: "YAML or JSON array of file/folder mappings to sync from this repo into the target repository. Each entry must have 'from' and 'to' fields (relative to repo roots), and an optional 'exclude' list of glob patterns. Only used when update_from_source is 'false'."
18
22
required: false
19
23
branch:
20
-
description: "Branch name to create or update in the target repository. Must be a stable name — do not use dynamic or timestamped names, or PR deduplication will break. Commits accumulate on this branch across runs."
24
+
description: "Branch name to create or update. Must be a stable name — do not use dynamic or timestamped names, or PR deduplication will break. Defaults to 'fern/pull-spec' for update_from_source mode and 'fern/sync-specs' for sync mode."
21
25
required: false
22
-
default: "fern/sync-openapi"
23
26
auto_merge:
24
-
description: "Set to 'true' to push directly to the branch without opening a PR. Set to 'false' to open a PR from the branch onto main. You must use 'true' when branch is 'main'."
27
+
description: "Set to 'true' to push directly to the branch without opening a PR. Set to 'false' to open a PR from the branch onto main."
0 commit comments