Skip to content

Commit 8f4def3

Browse files
committed
When splitting lines for the cross-PR checkout also split on \r\n
It seems like GitHub sometime in the last year started representing newlines in the PR description using \r\n instead of \n. Respect those as well to split the description into lines and find the linked PR indicator.
1 parent bca81f7 commit 8f4def3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/scripts/cross-pr-checkout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct CrossRepoPR {
142142
func getCrossRepoPrs(repository: String, prNumber: String) async throws -> [CrossRepoPR] {
143143
var result: [CrossRepoPR] = []
144144
let prInfo = try await getPRInfo(repository: repository, prNumber: prNumber)
145-
for line in prInfo.body?.split(separator: "\n") ?? [] {
145+
for line in prInfo.body?.split(whereSeparator: \.isNewline) ?? [] {
146146
guard line.lowercased().starts(with: "linked pr:") else {
147147
continue
148148
}

0 commit comments

Comments
 (0)