diff --git a/app/views/projects/push_rules/index.html.haml b/app/views/projects/push_rules/index.html.haml index 7f59e3681d00ee490c42886dba38ef28d08c7ebf..25b80203b9681a47f98ad9b1bdcc86c723b3a1c2 100644 --- a/app/views/projects/push_rules/index.html.haml +++ b/app/views/projects/push_rules/index.html.haml @@ -15,4 +15,5 @@ = form_for [@project.namespace.becomes(Namespace), @project, @push_rule] do |f| = form_errors(@push_rule) - = render "shared/push_rules_form", f: f + = render "shared/push_rules_form", f: f, + prevent_committing_secrets_check: true diff --git a/app/views/shared/_push_rules_form.html.haml b/app/views/shared/_push_rules_form.html.haml index ed85291891d5b6a186accd317798be13be11ead5..efaf6e348fdb7d1580522245c6a8e91be3572321 100644 --- a/app/views/shared/_push_rules_form.html.haml +++ b/app/views/shared/_push_rules_form.html.haml @@ -14,6 +14,17 @@ %p.light.append-bottom-0 Restrict commits by author (email) to existing GitLab users +- if local_assigns.fetch(:prevent_committing_secrets_check, false) + .form-group + = f.check_box :member_check, class: "pull-left" + .prepend-left-20 + = f.label :member_check, "Prevent committing secrets to git", class: "label-light append-bottom-0" + %p.light.append-bottom-0 + We'll reject anything that is likely to contain secrets from your commits. + The list of things we reject is available in + %a{ href: '/' } + the documentation. + .form-group = f.label :commit_message_regex, "Commit message", class: 'label-light' = f.text_field :commit_message_regex, class: "form-control", placeholder: 'Example: Fixes \d+\..*'