From 0e58d9371ee584f8353fbf1e77cb4be2e86acc8f Mon Sep 17 00:00:00 2001 From: Luke Bennett Date: Thu, 8 Sep 2016 20:00:34 +0100 Subject: [PATCH] Added prevent committing secrets checkbox --- app/views/projects/push_rules/index.html.haml | 3 ++- app/views/shared/_push_rules_form.html.haml | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/projects/push_rules/index.html.haml b/app/views/projects/push_rules/index.html.haml index 7f59e3681d00ee..25b80203b9681a 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 ed85291891d5b6..efaf6e348fdb7d 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+\..*' -- GitLab