X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fgit-validate-info-yaml.sh;fp=shell%2Fgit-validate-info-yaml.sh;h=80a4e24e1e6b8ad2cc9380cbe8928f46f097b117;hb=b83660faf15e9b6983d5d6baa031ecec710140b8;hp=0000000000000000000000000000000000000000;hpb=27090106c7bb23ff93bda6bb9798fe3b94686124;p=releng%2Fglobal-jjb.git diff --git a/shell/git-validate-info-yaml.sh b/shell/git-validate-info-yaml.sh new file mode 100644 index 00000000..80a4e24e --- /dev/null +++ b/shell/git-validate-info-yaml.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: EPL-1.0 +############################################################################## +# Copyright (c) 2018 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## +echo '--> git-validate-info-yaml.sh' +# This script will make sure that the INFO.yaml file changes are kept +# isolated from other file changes. +# INFO.yaml file creation or moddifications should be kept in its own separate +# Gerrit. + +# This script will fail if other file changes are also included in the same +# patch. + +# Ensure we fail the job if any steps fail. +set -e -o pipefail +set +u + +MODIFIED_FILES=$(git diff --name-only HEAD~1) + +if [ "$MODIFIED_FILES" != "INFO.yaml" ]; then + echo 'ERROR: Do not combine INFO.yaml file changes with other files. Please isolate INFO.yaml changes.' + exit 1 +fi