diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 000000000..462f9be92 --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,17 @@ +# name of the action +name: validate PR title + +# trigger on pull_request events of the opened & edited type. +on: + pull_request: + types: [opened, synchronize, edited, reopened] + +# pipeline to execute +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: validate title + run: | + echo "${{ github.event.pull_request.title }}" | grep -Eq '^(feat|fix|chore|refactor|enhance|test|docs)(\(.*\)|):\s.+$' && (echo "Pass"; exit 0) || (echo "Incorrect Format. Please see https://go-vela.github.io/docs/community/contributing_guidelines/#development-workflow"; exit 1) diff --git a/cypress/fixtures/repository.json b/cypress/fixtures/repository.json index 4ac27f803..6a4f6da8e 100644 --- a/cypress/fixtures/repository.json +++ b/cypress/fixtures/repository.json @@ -36,6 +36,9 @@ "comment": { "created": false, "edited": false + }, + "schedule": { + "run": false } }, "pipeline_type": "yaml", diff --git a/cypress/fixtures/secret_org.json b/cypress/fixtures/secret_org.json index 7f35d68bc..2e44df64e 100644 --- a/cypress/fixtures/secret_org.json +++ b/cypress/fixtures/secret_org.json @@ -8,5 +8,27 @@ "type": "org", "images": [], "events": ["push"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true } diff --git a/cypress/fixtures/secret_repo.json b/cypress/fixtures/secret_repo.json index f61636440..8281b8793 100644 --- a/cypress/fixtures/secret_repo.json +++ b/cypress/fixtures/secret_repo.json @@ -8,5 +8,27 @@ "type": "repo", "images": [], "events": ["push"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true } diff --git a/cypress/fixtures/secret_shared.json b/cypress/fixtures/secret_shared.json index 0f9479223..1f11e9a7b 100644 --- a/cypress/fixtures/secret_shared.json +++ b/cypress/fixtures/secret_shared.json @@ -8,5 +8,27 @@ "type": "shared", "images": [], "events": ["push"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true } diff --git a/cypress/fixtures/secrets_org_5.json b/cypress/fixtures/secrets_org_5.json index 2432d9e41..006f90103 100644 --- a/cypress/fixtures/secrets_org_5.json +++ b/cypress/fixtures/secrets_org_5.json @@ -9,6 +9,28 @@ "type": "org", "images": [], "events": ["push"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true }, { @@ -21,6 +43,28 @@ "type": "org", "images": [], "events": ["push"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true }, { @@ -33,6 +77,28 @@ "type": "org", "images": [], "events": ["push"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true }, { @@ -45,6 +111,28 @@ "type": "org", "images": [], "events": ["push", "pull_request"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true }, { @@ -57,6 +145,28 @@ "type": "org", "images": [], "events": ["push", "pull_request", "comment", "deployment"], + "allow_events": { + "push": { + "branch": true, + "tag": false + }, + "pull_request": { + "opened": false, + "synchronize": false, + "edited": false, + "reopened": false + }, + "deployment": { + "created": false + }, + "comment": { + "created": false, + "edited": false + }, + "schedule": { + "run": true + } + }, "allow_command": true } ] diff --git a/src/elm/Pages/Secrets/Form.elm b/src/elm/Pages/Secrets/Form.elm index 3cea73219..4d3995ea5 100644 --- a/src/elm/Pages/Secrets/Form.elm +++ b/src/elm/Pages/Secrets/Form.elm @@ -18,10 +18,13 @@ import Html exposing ( Html , a + , br , button , code , div , em + , h2 + , h3 , input , label , p @@ -47,6 +50,7 @@ import Html.Attributes , wrap ) import Html.Events exposing (onClick, onInput) +import List exposing (append) import Pages.RepoSettings exposing (checkbox) import Pages.Secrets.Model exposing (DeleteSecretState(..), Model, Msg(..), PartialModel, SecretForm) import Util @@ -166,64 +170,97 @@ viewValueInput val placeholder_ = {-| viewEventsSelect : renders events input selection -} viewEventsSelect : SecretForm -> PartialModel a msg -> Html Msg -viewEventsSelect secretUpdate model = +viewEventsSelect secret model = let schedulesAllowed = Util.checkScheduleAllowlist model.secretsModel.org model.secretsModel.repo model.velaScheduleAllowlist scheduleOption = if schedulesAllowed then - checkbox "Schedule" - "schedule" - (eventEnabled "schedule" secretUpdate.events) - <| - OnChangeEvent "schedule" + [ strong [ class "settings-subtitle" ] [ text "Schedule" ] + , div [ class "form-controls", class "-two-col-secrets" ] + [ checkbox "Schedule" + "schedule" + secret.allowEvents.schedule.run + <| + OnChangeEvent "allow_schedule_run" + ] + ] else - text "" + [ text "" ] in section [] - [ div [ for "events-select" ] - [ strong [] [ text "Limit to Events" ] - , span [ class "field-description" ] - [ text "( " - , em [] [ text "at least one event must be selected" ] - , text " )" + (append + [ div [ for "events-select" ] + [ strong [] [ text "Limit to Events" ] + , span [ class "field-description" ] + [ text "( " + , em [] [ text "at least one event must be selected" ] + , text " )" + ] + , pullRequestWarning + ] + , strong [ class "settings-subtitle" ] [ text "Push" ] + , div [ class "form-controls", class "-two-col-secrets" ] + [ checkbox "Push" + "allow_push_branch" + secret.allowEvents.push.branch + <| + OnChangeEvent "allow_push_branch" + , checkbox "Tag" + "allow_push_tag" + secret.allowEvents.push.tag + <| + OnChangeEvent "allow_push_tag" + ] + , strong [ class "settings-subtitle" ] [ text "Pull Request" ] + , div [ class "form-controls", class "-two-col-secrets" ] + [ checkbox "Opened" + "allow_pull_opened" + secret.allowEvents.pull.opened + <| + OnChangeEvent "allow_pull_opened" + , checkbox "Synchronize" + "allow_pull_synchronize" + secret.allowEvents.pull.synchronize + <| + OnChangeEvent "allow_pull_synchronize" + , checkbox "Edited" + "allow_pull_edited" + secret.allowEvents.pull.edited + <| + OnChangeEvent "allow_pull_edited" + , checkbox "Reopened" + "allow_pull_reopened" + secret.allowEvents.pull.reopened + <| + OnChangeEvent "allow_pull_reopened" + ] + , strong [ class "settings-subtitle" ] [ text "Deployments" ] + , div [ class "form-controls", class "-two-col-secrets" ] + [ checkbox "Created" + "allow_deploy_created" + secret.allowEvents.deploy.created + <| + OnChangeEvent "allow_deploy_created" + ] + , strong [ class "settings-subtitle" ] [ text "Comment" ] + , div [ class "form-controls", class "-two-col-secrets" ] + [ checkbox "Created" + "allow_comment_created" + secret.allowEvents.comment.created + <| + OnChangeEvent "allow_comment_created" + , checkbox "Edited" + "allow_comment_edited" + secret.allowEvents.comment.edited + <| + OnChangeEvent "allow_comment_edited" ] - , pullRequestWarning - ] - , div - [ class "form-controls" - , class "-stack" - ] - [ checkbox "Push" - "push" - (eventEnabled "push" secretUpdate.events) - <| - OnChangeEvent "push" - , checkbox "Pull Request" - "pull_request" - (eventEnabled "pull_request" secretUpdate.events) - <| - OnChangeEvent "pull_request" - , checkbox "Tag" - "tag" - (eventEnabled "tag" secretUpdate.events) - <| - OnChangeEvent "tag" - , checkbox "Comment" - "comment" - (eventEnabled "comment" secretUpdate.events) - <| - OnChangeEvent "comment" - , checkbox "Deployment" - "deployment" - (eventEnabled "deployment" secretUpdate.events) - <| - OnChangeEvent "deployment" - , scheduleOption ] - ] + scheduleOption + ) {-| pullRequestWarning : renders disclaimer for pull request exposure diff --git a/src/elm/Pages/Secrets/Model.elm b/src/elm/Pages/Secrets/Model.elm index e05715b98..e487aa860 100644 --- a/src/elm/Pages/Secrets/Model.elm +++ b/src/elm/Pages/Secrets/Model.elm @@ -23,7 +23,7 @@ import Http.Detailed import LinkHeader exposing (WebLink) import Pages exposing (Page) import RemoteData exposing (WebData) -import Vela exposing (Copy, Engine, Key, Org, Repo, Secret, SecretType, Secrets, Team) +import Vela exposing (AllowEventsPayload, Copy, Engine, Key, Org, Repo, Secret, SecretType, Secrets, Team, defaultSecretAllowEvents) @@ -79,6 +79,7 @@ type alias SecretForm = , events : List String , imageInput : String , images : List String + , allowEvents : AllowEventsPayload , allowCommand : Bool , team : Key } @@ -86,7 +87,7 @@ type alias SecretForm = defaultSecretUpdate : SecretForm defaultSecretUpdate = - SecretForm "" "" defaultSecretEvents "" [] True "" + SecretForm "" "" defaultSecretEvents "" [] defaultSecretAllowEvents True "" defaultSecretEvents : List String diff --git a/src/elm/Pages/Secrets/Update.elm b/src/elm/Pages/Secrets/Update.elm index eeaf65b8c..622d2f39f 100644 --- a/src/elm/Pages/Secrets/Update.elm +++ b/src/elm/Pages/Secrets/Update.elm @@ -34,6 +34,7 @@ import Util exposing (stringToMaybe) import Vela exposing ( Copy + , Field , Secret , SecretType(..) , UpdateSecretPayload @@ -96,7 +97,7 @@ reinitializeSecretUpdate secretsModel secret = initSecretUpdate : Secret -> SecretForm initSecretUpdate secret = - SecretForm secret.name "" secret.events "" secret.images secret.allowCommand secret.team + SecretForm secret.name "" secret.events "" secret.images secret.allowEvents secret.allowCommand secret.team {-| updateSecretModel : makes an update to the appropriate secret update @@ -145,25 +146,74 @@ updateSecretField field value secret = {-| onChangeEvent : takes event and updates the secrets model based on the appropriate event -} -onChangeEvent : String -> Model msg -> Model msg -onChangeEvent event secretsModel = +onChangeEvent : String -> Bool -> Model msg -> Model msg +onChangeEvent event val secretsModel = let secretUpdate = Just secretsModel.form in case secretUpdate of Just s -> - updateSecretModel (updateSecretEvents event s) secretsModel + updateSecretModel (updateSecretEvents s event val) secretsModel Nothing -> secretsModel -{-| updateSecretEvents : takes event and updates secret update events --} -updateSecretEvents : String -> SecretForm -> SecretForm -updateSecretEvents event secret = - { secret | events = toggleEvent event secret.events } +updateSecretEvents : SecretForm -> Field -> Bool -> SecretForm +updateSecretEvents sform field value = + let + events = + sform.allowEvents + + pushActions = + events.push + + pullActions = + events.pull + + deployActions = + events.deploy + + commentActions = + events.comment + + scheduleActions = + events.schedule + in + case field of + "allow_push_branch" -> + { sform | allowEvents = { events | push = { pushActions | branch = value } } } + + "allow_push_tag" -> + { sform | allowEvents = { events | push = { pushActions | tag = value } } } + + "allow_pull_opened" -> + { sform | allowEvents = { events | pull = { pullActions | opened = value } } } + + "allow_pull_synchronize" -> + { sform | allowEvents = { events | pull = { pullActions | synchronize = value } } } + + "allow_pull_edited" -> + { sform | allowEvents = { events | pull = { pullActions | edited = value } } } + + "allow_pull_reopened" -> + { sform | allowEvents = { events | pull = { pullActions | reopened = value } } } + + "allow_deploy_created" -> + { sform | allowEvents = { events | deploy = { deployActions | created = value } } } + + "allow_comment_created" -> + { sform | allowEvents = { events | comment = { commentActions | created = value } } } + + "allow_comment_edited" -> + { sform | allowEvents = { events | comment = { commentActions | edited = value } } } + + "allow_schedule_run" -> + { sform | allowEvents = { events | schedule = { scheduleActions | run = value } } } + + _ -> + sform {-| onAddImage : takes image and updates secret update images @@ -228,17 +278,6 @@ onChangeAllowCommand allow secretsModel = secretsModel -{-| toggleEvent : takes event and toggles inclusion in the events array --} -toggleEvent : String -> List String -> List String -toggleEvent event events = - if List.member event events && List.length events > 1 then - List.Extra.remove event events - - else - event :: events - - {-| getKey : gets the appropriate secret key based on type -} getKey : Model msg -> String @@ -283,6 +322,7 @@ toAddSecretPayload secretsModel secret = (stringToMaybe secret.value) (Just secret.events) (Just secret.images) + (Just secret.allowEvents) (Just secret.allowCommand) @@ -300,10 +340,11 @@ toUpdateSecretPayload secretsModel secret = , value = stringToMaybe secret.value , events = Just secret.events , images = Just secret.images + , allowEvents = Just secret.allowEvents , allowCommand = Just secret.allowCommand } in - buildUpdateSecretPayload args.type_ args.org args.repo args.team args.name args.value args.events args.images args.allowCommand + buildUpdateSecretPayload args.type_ args.org args.repo args.team args.name args.value args.events args.images args.allowEvents args.allowCommand @@ -321,8 +362,8 @@ update model msg = OnChangeStringField field value -> ( onChangeStringField field value secretsModel, Cmd.none ) - OnChangeEvent event _ -> - ( onChangeEvent event secretsModel, Cmd.none ) + OnChangeEvent event val -> + ( onChangeEvent event val secretsModel, Cmd.none ) AddImage image -> ( onAddImage image secretsModel, Cmd.none ) diff --git a/src/elm/Pages/Secrets/View.elm b/src/elm/Pages/Secrets/View.elm index 2a6d4e6b6..6d51897b2 100644 --- a/src/elm/Pages/Secrets/View.elm +++ b/src/elm/Pages/Secrets/View.elm @@ -25,7 +25,8 @@ import Url exposing (percentEncode) import Util exposing (largeLoader) import Vela exposing - ( Secret + ( AllowEvents + , Secret , SecretType(..) , Secrets , secretTypeToString @@ -360,7 +361,7 @@ renderSecret type_ secret = , scope "row" , class "break-word" ] - [ renderListCell secret.events "no events" "secret-event" ] + [ renderListCell (allowEventsToList secret.allowEvents) "no events" "secret-event" ] , td [ attribute "data-label" "images" , scope "row" @@ -421,7 +422,7 @@ renderSharedSecret type_ secret = , scope "row" , class "break-word" ] - [ renderListCell secret.events "no events" "secret-event" ] + [ renderListCell (allowEventsToList secret.allowEvents) "no events" "secret-event" ] , td [ attribute "data-label" "images" , scope "row" @@ -454,6 +455,32 @@ renderListCell items none itemClassName = ) +appendLabel : Bool -> String -> List String -> List String +appendLabel enabled label inList = + inList + ++ (if enabled then + [ label ] + + else + [] + ) + + +allowEventsToList : AllowEvents -> List String +allowEventsToList events = + [] + |> appendLabel events.push.branch "push" + |> appendLabel events.push.tag "tag" + |> appendLabel events.pull.opened "pull_request:opened" + |> appendLabel events.pull.synchronize "pull_request:synchronize" + |> appendLabel events.pull.edited "pull_request:edited" + |> appendLabel events.pull.reopened "pull_request:reopened" + |> appendLabel events.deploy.created "deployment" + |> appendLabel events.comment.created "comment:created" + |> appendLabel events.comment.edited "comment:edited" + |> appendLabel events.schedule.run "schedule" + + {-| listItemView : takes classname, text and size constraints and renders a list element -} listItemView : String -> String -> Html msg diff --git a/src/elm/Vela.elm b/src/elm/Vela.elm index d200c3cc0..65c58ced6 100644 --- a/src/elm/Vela.elm +++ b/src/elm/Vela.elm @@ -6,6 +6,7 @@ SPDX-License-Identifier: Apache-2.0 module Vela exposing ( AddSchedulePayload , AllowEvents + , AllowEventsPayload , AuthParams , Build , BuildGraph @@ -121,6 +122,8 @@ module Vela exposing , defaultPipeline , defaultPipelineTemplates , defaultRepoModel + , defaultSecretAllowEvents + , defaultSecretAllowEventsPayload , defaultStep , encodeBuildGraphRenderData , encodeDeploymentPayload @@ -947,11 +950,17 @@ type alias CommentActions = } +type alias ScheduleActions = + { run : Bool + } + + type alias AllowEvents = { push : PushActions , pull : PullActions , deploy : DeployActions , comment : CommentActions + , schedule : ScheduleActions } @@ -1029,6 +1038,12 @@ decodeCommentActions = |> required "edited" bool +decodeScheduleActions : Decoder ScheduleActions +decodeScheduleActions = + Decode.succeed ScheduleActions + |> required "run" bool + + decodeAllowEvents : Decoder AllowEvents decodeAllowEvents = Decode.succeed AllowEvents @@ -1036,6 +1051,7 @@ decodeAllowEvents = |> required "pull_request" decodePullActions |> required "deployment" decodeDeployActions |> required "comment" decodeCommentActions + |> required "schedule" decodeScheduleActions decodeRepositories : Decoder (List Repository) @@ -1161,6 +1177,7 @@ encodeAllowEvents events = , ( "pull_request", encodePullActions events.pull ) , ( "deployment", encodeDeployActions events.deploy ) , ( "comment", encodeCommentActions events.comment ) + , ( "schedule", encodeScheduleActions events.schedule ) ] @@ -1197,6 +1214,13 @@ encodeCommentActions comment = ] +encodeScheduleActions : ScheduleActionsPayload -> Encode.Value +encodeScheduleActions schedule = + Encode.object + [ ( "run", Encode.bool <| schedule.run ) + ] + + type alias EnableRepositoryPayload = { org : String , name : String @@ -1220,6 +1244,7 @@ type alias AllowEventsPayload = , pull : PullActionsPayload , deploy : DeployActionsPayload , comment : CommentActionsPayload + , schedule : ScheduleActionsPayload } @@ -1248,6 +1273,11 @@ type alias CommentActionsPayload = } +type alias ScheduleActionsPayload = + { run : Bool + } + + defaultEnableRepositoryPayload : EnableRepositoryPayload defaultEnableRepositoryPayload = EnableRepositoryPayload "" "" "" "" "" False False True False False False False False Nothing @@ -1281,14 +1311,19 @@ defaultUpdateRepositoryPayload = UpdateRepositoryPayload Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing -defaultAllowEventsPayload : Repository -> AllowEventsPayload -defaultAllowEventsPayload repository = +defaultRepoAllowEventsPayload : Repository -> AllowEventsPayload +defaultRepoAllowEventsPayload repository = case repository.allow_events of Nothing -> - AllowEventsPayload (defaultPushActionsPayload Nothing) (defaultPullActionsPayload Nothing) (defaultDeployActionsPayload Nothing) (defaultCommentActionsPayload Nothing) + AllowEventsPayload (defaultPushActionsPayload Nothing) (defaultPullActionsPayload Nothing) (defaultDeployActionsPayload Nothing) (defaultCommentActionsPayload Nothing) (defaultScheduleActionsPayload Nothing) Just events -> - AllowEventsPayload (defaultPushActionsPayload (Just events.push)) (defaultPullActionsPayload (Just events.pull)) (defaultDeployActionsPayload (Just events.deploy)) (defaultCommentActionsPayload (Just events.comment)) + AllowEventsPayload (defaultPushActionsPayload (Just events.push)) (defaultPullActionsPayload (Just events.pull)) (defaultDeployActionsPayload (Just events.deploy)) (defaultCommentActionsPayload (Just events.comment)) (defaultScheduleActionsPayload (Just events.schedule)) + + +defaultSecretAllowEventsPayload : Secret -> AllowEventsPayload +defaultSecretAllowEventsPayload secret = + AllowEventsPayload (defaultPushActionsPayload (Just secret.allowEvents.push)) (defaultPullActionsPayload (Just secret.allowEvents.pull)) (defaultDeployActionsPayload (Just secret.allowEvents.deploy)) (defaultCommentActionsPayload (Just secret.allowEvents.comment)) (defaultScheduleActionsPayload (Just secret.allowEvents.schedule)) defaultPushActionsPayload : Maybe PushActions -> PushActionsPayload @@ -1331,6 +1366,16 @@ defaultCommentActionsPayload commentActions = CommentActionsPayload comment.created comment.edited +defaultScheduleActionsPayload : Maybe ScheduleActions -> ScheduleActionsPayload +defaultScheduleActionsPayload scheduleActions = + case scheduleActions of + Nothing -> + ScheduleActionsPayload False + + Just schedule -> + ScheduleActionsPayload schedule.run + + encodeUpdateRepository : UpdateRepositoryPayload -> Encode.Value encodeUpdateRepository repo = Encode.object @@ -1376,7 +1421,7 @@ buildUpdateRepoEventsPayload : Repository -> Field -> Bool -> UpdateRepositoryPa buildUpdateRepoEventsPayload repository field value = let events = - defaultAllowEventsPayload repository + defaultRepoAllowEventsPayload repository pushActions = events.push @@ -2357,6 +2402,7 @@ type alias Secret = , type_ : SecretType , images : List String , events : List String + , allowEvents : AllowEvents , allowCommand : Bool } @@ -2455,6 +2501,11 @@ secretToKey secret = secret.org ++ "/" ++ secret.repo ++ "/" ++ secret.name +defaultSecretAllowEvents : AllowEvents +defaultSecretAllowEvents = + { push = { branch = True, tag = True }, pull = defaultPullActionsPayload Nothing, deploy = { created = True }, comment = defaultCommentActionsPayload Nothing, schedule = defaultScheduleActionsPayload Nothing } + + decodeSecret : Decoder Secret decodeSecret = Decode.succeed Secret @@ -2467,6 +2518,7 @@ decodeSecret = |> optional "type" secretTypeDecoder RepoSecret |> optional "images" (Decode.list string) [] |> optional "events" (Decode.list string) [] + |> optional "allow_events" decodeAllowEvents defaultSecretAllowEvents |> optional "allow_command" bool False @@ -2490,6 +2542,7 @@ type alias UpdateSecretPayload = , value : Maybe String , events : Maybe (List String) , images : Maybe (List String) + , allowEvents : Maybe AllowEventsPayload , allowCommand : Maybe Bool } @@ -2505,6 +2558,7 @@ encodeUpdateSecret secret = , ( "value", encodeOptional Encode.string secret.value ) , ( "events", encodeOptionalList Encode.string secret.events ) , ( "images", encodeOptionalList Encode.string secret.images ) + , ( "allow_events", encodeOptional encodeAllowEvents secret.allowEvents ) , ( "allow_command", encodeOptional Encode.bool secret.allowCommand ) ] @@ -2518,10 +2572,11 @@ buildUpdateSecretPayload : -> Maybe String -> Maybe (List String) -> Maybe (List String) + -> Maybe AllowEvents -> Maybe Bool -> UpdateSecretPayload -buildUpdateSecretPayload type_ org repo team name value events images allowCommand = - UpdateSecretPayload type_ org repo team name value events images allowCommand +buildUpdateSecretPayload type_ org repo team name value events images allowEvents allowCommand = + UpdateSecretPayload type_ org repo team name value events images allowEvents allowCommand diff --git a/src/scss/_forms.scss b/src/scss/_forms.scss index e7ddc1be7..9f403bbc5 100644 --- a/src/scss/_forms.scss +++ b/src/scss/_forms.scss @@ -261,6 +261,16 @@ } } + &.-two-col-secrets { + flex-flow: row wrap; + gap: 0.5rem; + max-width: 30%; + + .form-control { + flex: 0 0 40%; + } + } + .form-control { margin-right: 0.5rem; }