From 9cd12ceb79187a5077a7e42f2db14e9d3c296c8d Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Mon, 18 May 2026 19:30:56 -0400 Subject: [PATCH] Fix ASC key format detection: handle both raw PEM and base64 The secret may contain either raw PEM text (with BEGIN header) or base64-encoded PEM. Detect format and pass appropriately to fastlane instead of blindly base64-decoding (which corrupts raw PEM content). --- mobile/fastlane/Fastfile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mobile/fastlane/Fastfile b/mobile/fastlane/Fastfile index 57f5ff3..e3c3bab 100644 --- a/mobile/fastlane/Fastfile +++ b/mobile/fastlane/Fastfile @@ -20,12 +20,20 @@ platform :ios do lane :beta do setup_ci - key_content = Base64.decode64(ENV["ASC_KEY_CONTENT"]) + raw = ENV["ASC_KEY_CONTENT"] + if raw.include?("BEGIN") + key_content = raw.gsub('\n', "\n") + is_base64 = false + else + key_content = raw + is_base64 = true + end + app_store_connect_api_key( key_id: ENV["ASC_KEY_ID"], issuer_id: ENV["ASC_ISSUER_ID"], key_content: key_content, - is_key_content_base64: false + is_key_content_base64: is_base64 ) match(type: "appstore", readonly: true)