diff --git a/fastlane/Fastfile.swift b/fastlane/Fastfile.swift index 80cf5726..ab9159bd 100644 --- a/fastlane/Fastfile.swift +++ b/fastlane/Fastfile.swift @@ -16,12 +16,12 @@ class Fastfile: LaneFile { func testFlightLane(withOptions options: [String: String]?) { guard let options, - let keyID = options["keyID"], - let issuerID = options["issuerID"], - let keyContents = options["keyContents"], - let scheme = options["scheme"], - let codeSign64 = options["codeSign64"], - let profileName64 = options["profileName64"] + let keyID = options["keyID"]?.trimOption(), + let issuerID = options["issuerID"]?.trimOption(), + let keyContents = options["keyContents"]?.trimOption(), + let scheme = options["scheme"]?.trimOption(), + let codeSign64 = options["codeSign64"]?.trimOption(), + let profileName64 = options["profileName64"]?.trimOption() else { puts(message: "ERROR: missing or incorrect options") exit(1) @@ -97,3 +97,12 @@ class Fastfile: LaneFile { return decoded } } + +extension String { + + /// Trim the option value from whitespaces and newlines, which may + /// accidentally be present in GitHub secrets. + func trimOption() -> String { + trimmingCharacters(in: .whitespacesAndNewlines) + } +} diff --git a/fastlane/FastlaneRunner b/fastlane/FastlaneRunner index 070c8495..935461e2 100755 Binary files a/fastlane/FastlaneRunner and b/fastlane/FastlaneRunner differ