From 0533d22388bfcefc4048dfaf187ed6877cef8846 Mon Sep 17 00:00:00 2001 From: "Julian K. Arni" Date: Wed, 16 Jul 2025 16:53:38 +0200 Subject: [PATCH] Add installation field to PushEvent --- spec/DecodeEventsSpec.hs | 7 ++++++- src/GitHub/Data/Webhooks/Events.hs | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/DecodeEventsSpec.hs b/spec/DecodeEventsSpec.hs index 79915ec..013f697 100644 --- a/spec/DecodeEventsSpec.hs +++ b/spec/DecodeEventsSpec.hs @@ -5801,6 +5801,7 @@ pushEventFixture = PushEvent , whUserType = OwnerUser , whUserIsAdminOfSite = False } + , evPushInstallation = Nothing } pushEventFixtureWithoutSender :: PushEvent @@ -5923,7 +5924,11 @@ pushEventFixtureWithoutSender = whOrgDescription = "Plurality Media" } ), - evPushSender = Nothing + evPushSender = Nothing, + evPushInstallation = Just $ HookChecksInstallation + { whChecksInstallationId = 17816238 + , whChecksInstallationNodeId = "MDIzklOdGunVcFm0WauSW9z5GFdsGb0FW9uaTMgM3zcNjg4=" + } } releaseEventFixture :: ReleaseEvent diff --git a/src/GitHub/Data/Webhooks/Events.hs b/src/GitHub/Data/Webhooks/Events.hs index f4a132d..2281680 100644 --- a/src/GitHub/Data/Webhooks/Events.hs +++ b/src/GitHub/Data/Webhooks/Events.hs @@ -1119,6 +1119,7 @@ data PushEvent = PushEvent , evPushOrganization :: !(Maybe HookOrganization) -- | In very rare cases, the sender may be missing. , evPushSender :: !(Maybe HookUser) + , evPushInstallation :: !(Maybe HookChecksInstallation) } deriving (Eq, Show, Typeable, Data, Generic) @@ -1575,6 +1576,7 @@ instance FromJSON PushEvent where <*> o .: "repository" <*> o .:? "organization" <*> o .:? "sender" + <*> o .:? "installation" instance FromJSON ReleaseEvent where parseJSON = withObject "ReleaseEvent" $ \o -> ReleaseEvent