Skip to content

Commit 5867741

Browse files
authored
When splitting lines for the cross-PR checkout also split on \r\n (#249)
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 61db691 commit 5867741

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)