From 74526d0fb9d6fdc582dafc80b40668fc3e392578 Mon Sep 17 00:00:00 2001 From: Daniel Arantes Loverde Date: Thu, 9 Jul 2026 16:21:02 -0300 Subject: [PATCH] [ci-bitrise] Fix apikey.json generation to escape multi-line PEM content ASC_KEY_CONTENT is the raw .p8 private key, which contains literal newlines. The heredoc interpolated it straight into a JSON string, producing invalid JSON (JSON::ParserError in get_provisioning_profile). Build the file with Ruby's JSON encoder instead so newlines are escaped correctly. Verified locally against a realistic multi-line PEM value. --- bitrise.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index 7481006..cb11e31 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -43,9 +43,18 @@ workflows: inputs: - content: | echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig" - cat > "$BITRISE_SOURCE_DIR/Darwin/fastlane/apikey.json" < ENV["ASC_KEY_ID"], + "issuer_id" => ENV["ASC_ISSUER_ID"], + "key" => ENV["ASC_KEY_CONTENT"], + "in_house" => false + })) + ' - fastlane@3: inputs: - lane: beta @@ -77,9 +86,18 @@ workflows: inputs: - content: | echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig" - cat > "$BITRISE_SOURCE_DIR/Darwin/fastlane/apikey.json" < ENV["ASC_KEY_ID"], + "issuer_id" => ENV["ASC_ISSUER_ID"], + "key" => ENV["ASC_KEY_CONTENT"], + "in_house" => false + })) + ' - fastlane@3: inputs: - lane: release