Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / shell / git-validate-info-yaml.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo '--> git-validate-info-yaml.sh'
12 # This script will make sure that the INFO.yaml file changes are kept
13 # isolated from other file changes.
14 # INFO.yaml file creation or moddifications should be kept in its own separate
15 # Gerrit.
16
17 # This script will fail if other file changes are also included in the same
18 # patch.
19
20 # Ensure we fail the job if any steps fail.
21 set -e -o pipefail
22 set +u
23
24 MODIFIED_FILES=$(git diff --name-only HEAD~1)
25
26 if [ "$MODIFIED_FILES" != "INFO.yaml" ]; then
27     echo 'ERROR: Do not combine INFO.yaml file changes with other files. Please isolate INFO.yaml changes.'
28     exit 1
29 fi