Skip to content
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
9 changes: 9 additions & 0 deletions spec/DecodeEventsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5684,6 +5684,9 @@ pushEventFixture = PushEvent
, whSimplUserEmail = "[email protected]"
, whSimplUserLogin = Just "baxterthehacker"
}
, whCommitDistinct = Just True
, whCommitMessage = Just "Update README.md"
, whCommitTimestamp = Just $ read "2015-05-05 23:40:15Z"
}
]
, evPushHeadCommit =
Expand All @@ -5707,6 +5710,9 @@ pushEventFixture = PushEvent
, whSimplUserEmail = "[email protected]"
, whSimplUserLogin = Just "baxterthehacker"
}
, whCommitDistinct = Just True
, whCommitMessage = Just "Update README.md"
, whCommitTimestamp = Just $ read "2015-05-05 23:40:15Z"
}
, evPushRepository =
HookRepository
Expand Down Expand Up @@ -6269,6 +6275,9 @@ statusEventFixture = StatusEvent
, whUserType = OwnerUser
, whUserIsAdminOfSite = False
}
, whCommitDistinct = Nothing
, whCommitMessage = Nothing
, whCommitTimestamp = Nothing
}
, evStatusCreatedAt = read "2015-05-05 23:40:39Z"
, evStatusUpdatedAt = read "2015-05-05 23:40:39Z"
Expand Down
6 changes: 6 additions & 0 deletions src/GitHub/Data/Webhooks/Payload.hs
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ data HookCommit = HookCommit
, whCommitCommentsUrl :: !(Maybe URL) -- ^ Not always sent.
, whCommitAuthor :: !(Either HookSimpleUser HookUser)
, whCommitCommitter :: !(Either HookSimpleUser HookUser)
, whCommitDistinct :: !(Maybe Bool) -- ^ Whether this commit is distinct from any that have been pushed before. Not always sent.
, whCommitMessage :: !(Maybe Text) -- ^ Not always sent
, whCommitTimestamp :: !(Maybe UTCTime) -- ^ Not always sent.
}
deriving (Eq, Show, Typeable, Data, Generic)

Expand Down Expand Up @@ -1507,6 +1510,9 @@ instance FromJSON HookCommit where
<*> o .:? "comments_url"
<*> ((Right <$> o .: "author") <|> (Left <$> o .: "author")) -- try complex form first
<*> ((Right <$> o .: "committer") <|> (Left <$> o .: "committer")) -- try complex form first
<*> o .:? "distinct"
<*> o .:? "message"
<*> o .:? "timestamp"

instance FromJSON HookRelease where
parseJSON = withObject "HookRelease" $ \o -> HookRelease
Expand Down