Skip to content

Add installation field to PushEvent #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion spec/DecodeEventsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5801,6 +5801,7 @@ pushEventFixture = PushEvent
, whUserType = OwnerUser
, whUserIsAdminOfSite = False
}
, evPushInstallation = Nothing
}

pushEventFixtureWithoutSender :: PushEvent
Expand Down Expand Up @@ -5923,7 +5924,11 @@ pushEventFixtureWithoutSender =
whOrgDescription = "Plurality Media"
}
),
evPushSender = Nothing
evPushSender = Nothing,
evPushInstallation = Just $ HookChecksInstallation
{ whChecksInstallationId = 17816238
, whChecksInstallationNodeId = "MDIzklOdGunVcFm0WauSW9z5GFdsGb0FW9uaTMgM3zcNjg4="
}
}

releaseEventFixture :: ReleaseEvent
Expand Down
2 changes: 2 additions & 0 deletions src/GitHub/Data/Webhooks/Events.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down