Skip to content
Merged
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
17 changes: 15 additions & 2 deletions app/src/App/GitHubIssue.purs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ initializeGitHub = do
NotJson ->
pure Nothing

DecodedOperation _ "pacchettibotti" _ -> do
Console.log "Skipping operation from pacchettibotti to avoid feedback loops."
pure Nothing

MalformedJson issue err -> do
let
comment = String.joinWith "\n"
Expand Down Expand Up @@ -340,12 +344,21 @@ readOperation eventPath = do
let hasKeys = all (flip Array.elem keys)
if hasKeys [ "packages" ] then
map (Left <<< PackageSetUpdate) (CJ.decode Operation.packageSetUpdateCodec json)
else if hasKeys [ "name", "ref", "compiler" ] then
else if hasKeys [ "name", "ref", "version" ] then
map (Right <<< Publish) (CJ.decode Operation.publishCodec json)
else if hasKeys [ "payload", "signature" ] then
map (Right <<< Authenticated) (CJ.decode Operation.authenticatedCodec json)
else
Left $ CJ.DecodeError.basic "Operation: Expected a valid registry operation, but provided object did not match any operation decoder."
Left $ CJ.DecodeError.basic $ String.joinWith "\n"
[ "Could not match JSON keys to a registry operation."
, ""
, "Received keys: " <> String.joinWith ", " keys
, ""
, "Expected one of:"
, " - Package set update: { packages, compiler? }"
, " - Publish: { name, ref, compiler, version, location?, resolutions? }"
, " - Authenticated (unpublish/transfer): { payload, signature }"
]

case JSON.parse (JsonRepair.tryRepair (firstObject body)) of
Left err -> do
Expand Down