Skip to content

Commit 4bc74e6

Browse files
levindixonclaude
andauthored
Re-enable the TypeScript SDK release workflow (#679)
Move ts-sdk.yml back into .github/workflows. The release job now runs in the main environment, which is the only place FERN_TOKEN exists and whose branch policy limits it to runs from main. Pin actions/checkout, actions/setup-node and pnpm/action-setup to commits, declare read-only permissions, stop persisting git credentials, serialise runs, and cap the job at 30 minutes. The version input is validated as semver and passed through an environment variable instead of being interpolated into the shell. Drop FERN_NPM_TOKEN from both the workflow and the ts-sdk generator output. intercom-node publishes to npm through its own release workflow, and Fern only opens a pull request there. Fern's config loader fails on an undefined ${VAR}, so the two removals go together. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 131999b commit 4bc74e6

3 files changed

Lines changed: 56 additions & 33 deletions

File tree

‎.github/workflows-disabled/ts-sdk.yml‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎.github/workflows/ts-sdk.yml‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release TypeScript SDK
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "The version of the SDKs that you would like to release"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}
16+
cancel-in-progress: false
17+
18+
jobs:
19+
release:
20+
name: Release
21+
runs-on: ubuntu-latest
22+
# FERN_TOKEN is an environment secret; only runs from main can reach it.
23+
environment: main
24+
timeout-minutes: 30
25+
steps:
26+
- name: Checkout repo
27+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28+
with:
29+
persist-credentials: false
30+
31+
- name: Setup node
32+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
33+
with:
34+
node-version: 22
35+
package-manager-cache: false
36+
37+
- name: Install pnpm
38+
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
39+
40+
- name: Download Fern
41+
run: pnpm add -g fern-api@5.65.3
42+
43+
- name: Validate version input
44+
env:
45+
VERSION: ${{ inputs.version }}
46+
run: |
47+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
48+
echo "version must look like 7.0.5 or 7.0.5-beta.0, got: $VERSION"
49+
exit 1
50+
fi
51+
52+
- name: Release SDKs
53+
env:
54+
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
55+
VERSION: ${{ inputs.version }}
56+
run: fern generate --group ts-sdk --version "$VERSION" --log-level debug

‎fern/generators.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ groups:
3636
output:
3737
location: npm
3838
package-name: intercom-client
39-
token: ${FERN_NPM_TOKEN}
4039
github:
4140
repository: intercom/intercom-node
4241
mode: pull-request

0 commit comments

Comments
 (0)