422 means the release already exists, so… succeed

This commit is contained in:
Max Howell
2019-04-14 10:49:17 -04:00
parent 8d5d67b81b
commit b76db41ca4

6
.github/deploy vendored
View File

@@ -142,7 +142,11 @@ func publishRelease() throws -> Promise<Void> {
var rq = URLRequest(github: "/repos/\(slug)/releases")
rq.httpMethod = "POST"
rq.httpBody = try JSONEncoder().encode(Input())
return URLSession.shared.dataTask(.promise, with: rq).validate().asVoid()
return URLSession.shared.dataTask(.promise, with: rq).validate().asVoid().recover { err in
guard case PMKHTTPError.badStatusCode(422, _, _) = err else {
throw err
}
}
}
switch CommandLine.arguments[1] {