blob: 750705ac32ea179da592f33b2ddb2e9aa24e8b10 [file] [log] [blame]
#!/bin/bash
#
# Copyright 2020 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
readonly lakitu_files=$(echo "${PRESUBMIT_FILES}" | grep overlay-lakitu-arm64/)
if [[ -z "${lakitu_files}" ]]; then
exit 0
fi
readonly commit_desc="$(git log --format=%s%n%n%b "${PRESUBMIT_COMMIT}^!")"
# Checks for a non empty RELEASE_NOTE= filed.
RELEASE_NOTE_RE='RELEASE_NOTE=[^[:blank:]]+'
if [[ ! "${commit_desc}" =~ ${RELEASE_NOTE_RE} ]]; then
echo "Changelist description needs a RELEASE_NOTE= field (No space after =):"
echo "RELEASE_NOTE=New feature"
echo "RELEASE_NOTE=Bugfix"
echo "RELEASE_NOTE=None"
exit 1
fi