Un-escape \n in DEVELOPER_KEY_CONTENT before openssl conversion

GitHub secrets store multi-line PEMs as a single line with literal "\n"
sequences. Fastlane's app_store_connect_api_key action un-escapes them
via gsub before use; the helper must do the same before writing the
temp file, otherwise openssl sees garbage.
This commit is contained in:
Arkadiusz Fal
2026-04-18 19:05:44 +02:00
parent c978ec6b89
commit a26044cc04

View File

@@ -33,6 +33,10 @@ def developer_key_content
return @developer_key_content if defined?(@developer_key_content)
content = ENV['DEVELOPER_KEY_CONTENT']
return @developer_key_content = nil if content.nil? || content.empty?
# GitHub secrets carry multi-line PEMs as a single line with literal "\n"
# escapes; fastlane's action un-escapes these before use, so do the same
# here before invoking openssl.
content = content.gsub('\n', "\n")
@developer_key_content = Tempfile.open(['AuthKey', '.p8']) do |f|
f.write(content)
f.flush