Implements a system to process Xcode Cloud webhook events. This package is designed to work well with Swift on the Server, including Vapor and AWS Lamba.
Implement a type which conforms to XcodeCloudWebhookHandler
:
struct Handler: XcodeCloudWebhookHandler {
func run(with payload: Payload) async throws {
Task {
try await Task.sleep(nanoseconds: 1_000_000_000)
print("\(payload)")
}
}
}
Add the handler to the webhook runner:
let webhook = XcodeCloudWebhook()
await webhook.add(Handler())
Run the webhook:
try await webhook.run(payload)