From 95c99844f1f1ba07aa528da56df583b2d564478c Mon Sep 17 00:00:00 2001 From: tianma-if Date: Sun, 23 Aug 2026 12:06:39 +0800 Subject: [PATCH] fix(ios): query the Xcode Cloud product endpoint --- .github/workflows/ios-xcode-cloud.yml | 4 ++-- apps/ios/Scripts/ensure-xcode-cloud-build-number.sh | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ios-xcode-cloud.yml b/.github/workflows/ios-xcode-cloud.yml index b472816d..22421d79 100644 --- a/.github/workflows/ios-xcode-cloud.yml +++ b/.github/workflows/ios-xcode-cloud.yml @@ -80,9 +80,9 @@ jobs: details = error.read().decode() raise SystemExit(f"App Store Connect API {method} {path} failed ({error.code}): {details}") - products = api("GET", f"/v1/apps/{app_id}/ciProducts?limit=10") + product = api("GET", f"/v1/apps/{app_id}/ciProduct").get("data") workflows = [] - for product in products.get("data", []): + for product in [product] if product else []: product_id = product["id"] query = urllib.parse.urlencode({ "limit": 50, diff --git a/apps/ios/Scripts/ensure-xcode-cloud-build-number.sh b/apps/ios/Scripts/ensure-xcode-cloud-build-number.sh index 4c2be089..93a922c6 100755 --- a/apps/ios/Scripts/ensure-xcode-cloud-build-number.sh +++ b/apps/ios/Scripts/ensure-xcode-cloud-build-number.sh @@ -123,12 +123,12 @@ print( f"next = {desired} (or higher) before Start Build." ) -# Best-effort: list ciProducts for this app (manual UI remains source of truth for next number) -st, products = api("GET", f"/v1/apps/{app_id}/ciProducts?limit=10") -if isinstance(products, dict): - for p in products.get("data", []): - attrs = p.get("attributes") or {} - print(f"ciProduct id={p.get('id')} name={attrs.get('name')} productType={attrs.get('productType')}") +# Best-effort: read the ciProduct for this app (manual UI remains source of truth for next number) +st, product = api("GET", f"/v1/apps/{app_id}/ciProduct") +if isinstance(product, dict): + p = product.get("data") or {} + attrs = p.get("attributes") or {} + print(f"ciProduct id={p.get('id')} name={attrs.get('name')} productType={attrs.get('productType')}") if apply: version_file = ios_root / "Config" / "Version.xcconfig"