Trim Fastlane Options (#1367)

This commit is contained in:
Ethan Pippin 2024-12-17 14:58:44 -07:00 committed by GitHub
parent fe9a6375aa
commit 7685048258
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View File

@ -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)
}
}

Binary file not shown.