From 71ef4f9efc274c7023514edb6f77881c5e9f6484 Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Fri, 13 Mar 2026 15:08:24 +0300 Subject: [PATCH 1/3] fix: handle pre-release to stable upgrade detection in SDK update check The daily SDK update workflow missed cases where a stable release (e.g. 0.11.0) should replace a pinned pre-release (e.g. ^0.11.0-dev3). Add an opt-in `include-prerelease-upgrades` flag for manual workflow runs that strips range operators and compares raw versions. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/sdk-update-check.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sdk-update-check.yml b/.github/workflows/sdk-update-check.yml index 26d2f63..adb4d1e 100644 --- a/.github/workflows/sdk-update-check.yml +++ b/.github/workflows/sdk-update-check.yml @@ -4,6 +4,11 @@ on: schedule: - cron: '0 9 * * *' workflow_dispatch: + inputs: + include-prerelease-upgrades: + description: 'Also detect when a stable release replaces a pre-release (e.g. 0.11.0-dev3 → 0.11.0)' + type: boolean + default: false permissions: contents: read @@ -29,7 +34,22 @@ jobs: ") echo "Current: $CURRENT, Latest: $LATEST" - npx semver "$LATEST" -r ">$CURRENT" > /dev/null 2>&1 || { echo "Up to date."; exit 0; } + + # Standard range check (works for normal version bumps) + if npx semver "$LATEST" -r ">$CURRENT" > /dev/null 2>&1; then + echo "New version available." + elif [ "${{ inputs.include-prerelease-upgrades }}" = "true" ]; then + # Strip range operators (^, ~, etc.) and compare raw versions + # so that 0.11.0 is detected as newer than 0.11.0-dev3 + CURRENT_VER=$(echo "$CURRENT" | sed 's/^[^0-9]*//') + if npx semver "$LATEST" -r ">$CURRENT_VER" > /dev/null 2>&1; then + echo "Stable release available for current pre-release." + else + echo "Up to date."; exit 0 + fi + else + echo "Up to date."; exit 0 + fi COUNT=$(gh issue list --label sdk-upgrade --state open --json number --jq 'length') [ "$COUNT" -gt 0 ] && echo "Open issue already exists." && exit 0 From 93041ec888c3af0d3c4414d4cd36951d57c3124c Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Fri, 13 Mar 2026 15:14:52 +0300 Subject: [PATCH 2/3] fix: use PAT for issue creation to trigger downstream workflows Events created by GITHUB_TOKEN don't trigger other workflows. Switch to CLAUDE_CODE_OAUTH_TOKEN so the sdk-upgrade label event fires the Claude Code workflow. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/sdk-update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-update-check.yml b/.github/workflows/sdk-update-check.yml index adb4d1e..798497f 100644 --- a/.github/workflows/sdk-update-check.yml +++ b/.github/workflows/sdk-update-check.yml @@ -22,7 +22,7 @@ jobs: - name: Check for update and create issue env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} run: | set -euo pipefail From 5ad686b0c17f2cf451cd346f7bc547fc31b40daf Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Fri, 13 Mar 2026 15:21:28 +0300 Subject: [PATCH 3/3] fix: use SDK_CHECK_PAT for issue creation CLAUDE_CODE_OAUTH_TOKEN wasn't scoped for this workflow. Use a dedicated fine-grained PAT with issues:write permission. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/sdk-update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk-update-check.yml b/.github/workflows/sdk-update-check.yml index 798497f..fd9e013 100644 --- a/.github/workflows/sdk-update-check.yml +++ b/.github/workflows/sdk-update-check.yml @@ -22,7 +22,7 @@ jobs: - name: Check for update and create issue env: - GH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + GH_TOKEN: ${{ secrets.SDK_CHECK_PAT }} run: | set -euo pipefail