From 718155208153724c0cab33ae50513e0da5e8f034 Mon Sep 17 00:00:00 2001 From: Alistair Burrowes Date: Thu, 20 Jan 2022 11:12:19 +1100 Subject: [PATCH] [#56]: CheckSuite after field can be null (#55) Co-authored-by: Alistair Burrowes --- spec/DecodeEventsSpec.hs | 4 ++-- src/GitHub/Data/Webhooks/Payload.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/DecodeEventsSpec.hs b/spec/DecodeEventsSpec.hs index 12bb2a0..35fd2d3 100644 --- a/spec/DecodeEventsSpec.hs +++ b/spec/DecodeEventsSpec.hs @@ -94,7 +94,7 @@ checkSuiteEventFixture = CheckSuiteEvent , whCheckSuiteConclusion = Just HookCheckSuiteConclusionActionRequired , whCheckSuiteUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/check-suites/123451234" , whCheckSuiteBeforeSha = Just "15c99c3e0b9d840d8465be47813cf39686815f2e" - , whCheckSuiteAfterSha = "45deaf5013c757e58e2665849c3fd3add3edfa59" + , whCheckSuiteAfterSha = Just "45deaf5013c757e58e2665849c3fd3add3edfa59" , whCheckSuitePullRequests = V.fromList [ HookChecksPullRequest @@ -315,7 +315,7 @@ checkRunEventFixture = CheckRunEvent , whCheckSuiteConclusion = Nothing , whCheckSuiteUrl = URL "https://api.github.com/repos/baxterthehacker/public-repo/check-suites/123451234" , whCheckSuiteBeforeSha = Just "15c99c3e0b9d840d8465be47813cf39686815f2e" - , whCheckSuiteAfterSha = "45deaf5013c757e58e2665849c3fd3add3edfa59" + , whCheckSuiteAfterSha = Just "45deaf5013c757e58e2665849c3fd3add3edfa59" , whCheckSuitePullRequests = V.fromList [ HookChecksPullRequest diff --git a/src/GitHub/Data/Webhooks/Payload.hs b/src/GitHub/Data/Webhooks/Payload.hs index 4a1a628..baca996 100644 --- a/src/GitHub/Data/Webhooks/Payload.hs +++ b/src/GitHub/Data/Webhooks/Payload.hs @@ -601,7 +601,7 @@ data HookCheckSuite = HookCheckSuite , whCheckSuiteConclusion :: !(Maybe HookCheckSuiteConclusion) , whCheckSuiteUrl :: !URL , whCheckSuiteBeforeSha :: !(Maybe Text) - , whCheckSuiteAfterSha :: !Text + , whCheckSuiteAfterSha :: !(Maybe Text) , whCheckSuitePullRequests :: !(Vector HookChecksPullRequest) , whCheckSuiteCreatedAt :: !UTCTime , whCheckSuiteUpdatedAt :: !UTCTime @@ -1310,7 +1310,7 @@ instance FromJSON HookCheckSuite where <*> o .:? "conclusion" <*> o .: "url" <*> o .:? "before" - <*> o .: "after" + <*> o .:? "after" <*> o .: "pull_requests" <*> o .: "created_at" <*> o .: "updated_at"