From 6d1292e3ba0f3179f3ca706b928c5fcc29a87c03 Mon Sep 17 00:00:00 2001 From: Eric Van Norman Date: Tue, 13 Jul 2021 15:51:45 -0500 Subject: [PATCH] Fix automator script failing on exit code of 1 from grep --- tools/automator/automator.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/automator/automator.sh b/tools/automator/automator.sh index df96a577d03..e5216aa7749 100755 --- a/tools/automator/automator.sh +++ b/tools/automator/automator.sh @@ -284,7 +284,9 @@ merge() { # in the git_exclude list. If no files remain after exclusion, the automation script exits. validate_changes_exist_in_latest_commit() { if [ -n "$git_exclude" ]; then + set +e # grep will have an exit code of 1 if all files are excluded causing the script to fail changes=$(git show --name-only --pretty=oneline | sed 1d | grep -cvE "$git_exclude") # need to remove first line + set -e if [ "${changes}" -eq 0 ] then print_error_and_exit "No changes remaining in upstream PR after excluding" 0 # not really an error so return 0