Files
my-rook-config/tests/scripts/validate_modified_files.sh
T
subhamkrai afed5bf109 ci: fix codegen err
codegen is currently broken in master.
this commit fix the broken codegen by fixing
the correct working directory in gh action.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-03-01 10:29:26 +05:30

40 lines
704 B
Bash
Executable File

#!/bin/bash
set -ex
#############
# VARIABLES #
#############
MOD_FILE="mod"
CODEGEN_ERR="found codegen files! please run 'make codegen' and update your PR"
MOD_ERR="changes found by mod.check. You may need to run make clean"
#############
# FUNCTIONS #
#############
function validate(){
git=$(git status --porcelain)
for file in $git; do
if [ -n "$file" ]; then
echo "$1"
echo "$git"
exit 1
fi
done
}
########
# MAIN #
########
case "$1" in
codegen)
validate "$CODEGEN_ERR"
;;
modcheck)
validate "$MOD_FILE" "$MOD_ERR"
;;
*)
echo $"Usage: $0 {codegen|modcheck}"
exit 1
esac