diff --git a/src/GitHub/Data/Webhooks/Payload.hs b/src/GitHub/Data/Webhooks/Payload.hs index a6c8c33..c342ce6 100644 --- a/src/GitHub/Data/Webhooks/Payload.hs +++ b/src/GitHub/Data/Webhooks/Payload.hs @@ -59,8 +59,11 @@ import GHC.Generics (Generic) -- Types lifted from the @github@ package. --- | Represents the owner of the repository. -data OwnerType = OwnerUser | OwnerOrganization +-- | Represents the owner of a repository, pull request or similar. +-- +-- A bot is a "special type of user which takes actions on behalf of GitHub Apps". +-- See also https://developer.github.com/v4/object/bot/ +data OwnerType = OwnerUser | OwnerOrganization | OwnerBot deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Typeable, Data) instance NFData OwnerType @@ -70,6 +73,7 @@ instance FromJSON OwnerType where case T.toLower t of "user" -> pure OwnerUser "organization" -> pure OwnerOrganization + "bot" -> pure OwnerBot _ -> fail $ "Unknown owner type: " ++ T.unpack t