Skip to content

Commit

Permalink
refactor: rearrange type order and add allow events header
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Feb 5, 2024
1 parent 193069b commit ea5185d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/elm/Vela.elm
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,19 @@ defaultRepoPayload =
}



-- ALLOW EVENTS


type alias AllowEvents =
{ push : PushActions
, pull : PullActions
, deploy : DeployActions
, comment : CommentActions
, schedule : ScheduleActions
}


type alias PushActions =
{ branch : Bool
, tag : Bool
Expand Down Expand Up @@ -488,15 +501,6 @@ type alias ScheduleActions =
}


type alias AllowEvents =
{ push : PushActions
, pull : PullActions
, deploy : DeployActions
, comment : CommentActions
, schedule : ScheduleActions
}


defaultAllowEvents : AllowEvents
defaultAllowEvents =
{ push =
Expand Down Expand Up @@ -1302,7 +1306,6 @@ type alias Secret =
, name : String
, type_ : SecretType
, images : List String
, events : List String
, allowCommand : Bool
, allowEvents : AllowEvents
}
Expand Down Expand Up @@ -1388,7 +1391,6 @@ decodeSecret =
|> optional "name" string ""
|> optional "type" secretTypeDecoder RepoSecret
|> optional "images" (Json.Decode.list string) []
|> optional "events" (Json.Decode.list string) []
|> optional "allow_command" bool False
|> optional "allow_events" decodeAllowEvents defaultAllowEvents

Expand Down

0 comments on commit ea5185d

Please sign in to comment.