diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index 134d89d155c3..50c274128e84 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -91,4 +91,15 @@ if grep -q -R "WARNING" "$LOG_FILE_NAME"; then exit -1 fi +ALLOWED_CHECK_NOTES=3 +NUM_CHECK_NOTES=$( + cat ${LOG_FILE_NAME} \ + | grep -e '^Status: .* NOTE.*' \ + | sed 's/[^0-9]*//g' +) +if [[ ${NUM_CHECK_NOTES} -gt ${ALLOWED_CHECK_NOTES} ]]; then + echo "Found ${NUM_CHECK_NOTES} NOTEs from R CMD check. Only ${ALLOWED_CHECK_NOTES} are allowed" + exit -1 +fi + exit 0