From a83d23107730e91c9d4fe0b4af47952c84a317b2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Sep 2026 10:51:41 +0000 Subject: [PATCH] ci: release the SDK on any change that alters what it ships MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auto-release gate only fired on `clients/*/openapi.json`, so a change to the SDK's own runtime (proxy.ts, retry.ts, client-factory.ts), to a hand-written client module (schema-model.ts, additional-types.ts), or to the generator itself never published. #464 and #469 both landed on main unpublished and only shipped when an unrelated spec PR swept them up. The gate now matches those paths too, and excludes the generated output under src/{apis,types,models,definitions,docs} — the auto-release commit rewrites those itself, so matching them would make it re-trigger this job and bump versions in a loop. The release commit also now carries `[skip release]`, which the job's own `if` already honours, as a second layer in case the exclusion is later widened carelessly. Verified the new expression against real commit file lists: a spec change, #464, #469, an SDK runtime fix and a generator change all trigger; the auto-release commit 5e39d9ce, docs-only, changeset-only and generated-output-only changes all do not. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PXhwfYV419Bodt42E3aw2C --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03b8efe70..500ec2a2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,15 @@ jobs: id: check run: | CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD) - if echo "$CHANGED_FILES" | grep -q '^clients/.*/openapi\.json$'; then + + # Anything that changes what @epilot/sdk ships: a spec, a hand-written client + # module, the generator, or the SDK's own runtime. + SDK_PATHS='^(clients/.*/openapi\.json$|clients/[^/]+/src/(schema-model|additional-types|index)\.ts$|scripts/generate-sdk-v2\.ts$|packages/epilot-sdk-v2/src/)' + # ...but not the generated output, which the auto-release commit itself rewrites. + # Matching it would make that commit re-trigger this job in a loop. + SDK_GENERATED='^packages/epilot-sdk-v2/src/(apis|types|models|definitions|docs)/|^packages/epilot-sdk-v2/src/client-map\.ts$' + + if echo "$CHANGED_FILES" | grep -E "$SDK_PATHS" | grep -qvE "$SDK_GENERATED"; then echo "sdk=true" >> "$GITHUB_OUTPUT" else echo "sdk=false" >> "$GITHUB_OUTPUT" @@ -159,7 +167,8 @@ jobs: [ -n "$COMMIT_MSG" ] && COMMIT_MSG="$COMMIT_MSG, " COMMIT_MSG="${COMMIT_MSG}@epilot/cli@${CLI_VERSION}" fi - git commit -m "$COMMIT_MSG" + # `[skip release]` stops this commit from re-triggering the job (see the job `if`). + git commit -m "$COMMIT_MSG [skip release]" for TAG in $TAGS; do git tag "$TAG"