From 43a25d93ebdabea52f99b05e15b06250cd8f07d7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 17 May 2023 16:05:49 +0000 Subject: Add latest changes from gitlab-org/gitlab@16-0-stable-ee --- .lefthook/pre-push/security_harness | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 .lefthook/pre-push/security_harness (limited to '.lefthook/pre-push') diff --git a/.lefthook/pre-push/security_harness b/.lefthook/pre-push/security_harness new file mode 100755 index 00000000000..89a6d4a608d --- /dev/null +++ b/.lefthook/pre-push/security_harness @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e +shopt -s nocasematch # Enable case-insensitive matching + +local_branch="$(git rev-parse --abbrev-ref HEAD)" +security_branch_regex="^security.+" +url="$2" + +if [[ $local_branch =~ $security_branch_regex ]] && [[ "$url" != *"gitlab-org/security/"* ]] +then + echo "Pushing security branches to remotes other than gitlab.com/gitlab-org/security has been disabled!" + echo "Please read https://gitlab.com/gitlab-org/release/docs/blob/master/general/security/developer.md#do-not-push-to-gitlab-orggitlab" + echo + + exit 1 +fi -- cgit v1.2.3