Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(release): use Changesets v3 action protocol
jkomyno committed
Aug 25, 2026 at 01:11 UTC
3e8ce1eae27f47f5503b7d683ed9854a859b814a
3 files changed
+58
-32
.github/workflows/ts.release.yml
+6
-8
@@ -60,20 +60,18 @@ jobs:
60
61
- name: Create Release Pull Request & Publish packages
62
id: changesets
63
- uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0
63
+ uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
64
if: github.event_name != 'workflow_dispatch' # only run on master merges
65
- env:
66
- GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
67
- GITHUB_ACCESS_TOKEN: ${{ steps.app-token.outputs.token }}
65
with:
69
- publish: pnpm changeset:release
70
- commit: 'Release: update version'
71
- title: 'Release: update version'
66
+ github-token: ${{ steps.app-token.outputs.token }}
67
+ publish-script: pnpm changeset:release
68
+ commit-message: 'Release: update version'
69
+ pr-title: 'Release: update version'
70
71
- name: Set Version Info
72
if: steps.changesets.outputs.published == 'true'
73
env:
76
- PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
74
+ PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.published-packages }}
75
run: |
76
SLACK_VERSIONS=""
77
while read -r pkg; do
test/release-workflow.test.ts
+40
-12
@@ -258,7 +258,7 @@ touch "$target/dist/provider.whl"
258
}
259
}
260
261
-if (!tsReleaseWorkflow.includes('publish: pnpm changeset:release')) {
261
+if (!tsReleaseWorkflow.includes('publish-script: pnpm changeset:release')) {
262
throw new Error('ts.release.yml must use the repository-controlled changeset:release script');
263
}
264
@@ -336,6 +336,25 @@ if (
336
throw new Error('ts.release.yml must validate pending changesets before changesets/action');
337
}
338
339
+if (!tsReleaseWorkflow.includes('changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1')) {
340
+ throw new Error('ts.release.yml must use changesets/action v2 with Changesets v3');
341
+}
342
+
343
+for (const input of [
344
+ 'github-token: ${{ steps.app-token.outputs.token }}',
345
+ 'publish-script: pnpm changeset:release',
346
+ "commit-message: 'Release: update version'",
347
+ "pr-title: 'Release: update version'",
348
+]) {
349
+ if (!tsReleaseWorkflow.includes(input)) {
350
+ throw new Error(`ts.release.yml must use the changesets/action v2 ${input} input`);
351
+ }
352
+}
353
+
354
+if (!tsReleaseWorkflow.includes('steps.changesets.outputs.published-packages')) {
355
+ throw new Error('ts.release.yml must read the changesets/action v2 published-packages output');
356
+}
357
+
358
if (changesetConfig.baseBranch !== 'next') {
359
throw new Error('changesets must compare against next, the active release branch');
360
}
@@ -425,9 +444,9 @@ if (!releaseScript.includes('pnpm changeset publish')) {
444
throw new Error('release script must still publish non-CLI changeset packages');
445
}
446
428
-if (!releaseScript.includes('New tag:[[:space:]]*@composio\\/cli@')) {
447
+if (!releaseScript.includes('CHANGESETS_OUTPUT')) {
448
throw new Error(
430
- 'release script must filter @composio/cli tag output before changesets/action creates GitHub releases'
449
+ 'release script must filter @composio/cli Changesets v3 output before changesets/action creates GitHub releases'
450
);
451
}
452
@@ -781,6 +800,7 @@ for (const guide of mirroredUninstallGuides) {
800
const fakeBin = mkdtempSync(join(tmpdir(), 'composio-release-test-'));
801
try {
802
const fakePnpmPath = join(fakeBin, 'pnpm');
803
+ const changesetsOutputPath = join(fakeBin, 'changesets-output.ndjson');
804
writeFileSync(
805
fakePnpmPath,
806
`#!/usr/bin/env bash
@@ -790,8 +810,8 @@ case "$*" in
810
exit 0
811
;;
812
"changeset publish")
793
- echo 'New tag: @composio/core@1.2.3'
794
- echo 'New tag: @composio/cli@9.9.9'
813
+ printf '%s\\n' '{"type":"git-tag","tag":"@composio/core@1.2.3","packageName":"@composio/core"}' > "$CHANGESETS_OUTPUT"
814
+ printf '%s\\n' '{"type":"git-tag","tag":"@composio/cli@9.9.9","packageName":"@composio/cli"}' >> "$CHANGESETS_OUTPUT"
815
echo 'release warning preserved' >&2
816
exit 0
817
;;
@@ -806,7 +826,11 @@ esac
826
827
const result = spawnSync('bash', [releaseScriptPath], {
828
encoding: 'utf8',
809
- env: { ...process.env, PATH: `${fakeBin}:${process.env.PATH}` },
829
+ env: {
830
+ ...process.env,
831
+ CHANGESETS_OUTPUT: changesetsOutputPath,
832
+ PATH: `${fakeBin}:${process.env.PATH}`,
833
+ },
834
});
835
836
if (result.status !== 0) {
@@ -815,12 +839,16 @@ esac
839
);
840
}
841
818
- if (!result.stdout.includes('New tag: @composio/core@1.2.3')) {
819
- throw new Error('release script must preserve non-CLI changeset tags');
820
- }
821
-
822
- if (result.stdout.includes('@composio/cli@9.9.9')) {
823
- throw new Error('release script must hide @composio/cli tags from changesets/action');
842
+ const outputEvents = readFileSync(changesetsOutputPath, 'utf8')
843
+ .trim()
844
+ .split('\n')
845
+ .map(line => JSON.parse(line));
846
+ if (
847
+ outputEvents.length !== 1 ||
848
+ outputEvents[0].packageName !== '@composio/core' ||
849
+ outputEvents[0].tag !== '@composio/core@1.2.3'
850
+ ) {
851
+ throw new Error('release script must retain only non-CLI Changesets v3 git-tag events');
852
}
853
854
if (!result.stderr.includes('release warning preserved')) {
ts/scripts/changeset-release.sh
+12
-12
@@ -1,25 +1,25 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
4
-# changesets/action infers which GitHub tags/releases to push from `New tag:`
5
-# lines printed by `changeset publish`. The CLI binary workflow owns
6
-# @composio/cli GitHub Releases because those releases must include platform
7
-# binary assets. Let changesets publish/tag every other package, but hide the
8
-# private CLI tag from changesets/action so ts.release.yml cannot create an
9
-# empty @composio/cli GitHub Release.
4
+# changesets/action v2 reads Changesets v3's NDJSON events from
5
+# CHANGESETS_OUTPUT. The CLI binary workflow owns @composio/cli GitHub Releases
6
+# because those releases must include platform binary assets. Remove only that
7
+# package's git-tag event so changesets/action publishes and releases every
8
+# other package without creating an empty @composio/cli GitHub Release.
9
11
-stdout_file=$(mktemp)
12
-stderr_file=$(mktemp)
13
-trap 'rm -f "$stdout_file" "$stderr_file"' EXIT
10
+filtered_output_file=$(mktemp)
11
+trap 'rm -f "$filtered_output_file"' EXIT
12
13
pnpm run build:packages
14
15
set +e
18
-pnpm changeset publish >"$stdout_file" 2>"$stderr_file"
16
+pnpm changeset publish
17
status=$?
18
set -e
19
22
-sed '/New tag:[[:space:]]*@composio\/cli@/d' "$stdout_file"
23
-cat "$stderr_file" >&2
20
+if [ -n "${CHANGESETS_OUTPUT:-}" ] && [ -f "$CHANGESETS_OUTPUT" ]; then
21
+ jq -c 'select(.packageName != "@composio/cli")' "$CHANGESETS_OUTPUT" >"$filtered_output_file"
22
+ mv "$filtered_output_file" "$CHANGESETS_OUTPUT"
23
+fi
24
25
exit "$status"