From 79d3e695a03683a89c6e2429f2f3afa29c2be1a3 Mon Sep 17 00:00:00 2001 From: ydementieiev Date: Fri, 5 Jan 2024 01:26:26 -0700 Subject: [PATCH] Changed default exlude folders and added errors handling in script --- action.yml | 2 +- entrypoint.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0584ed6..f2d28c2 100644 --- a/action.yml +++ b/action.yml @@ -26,4 +26,4 @@ inputs: exclude_folders: description: 'Folders to exclude from formatting check' required: false - default: '3rdparty,3rd_party' + default: '' diff --git a/entrypoint.sh b/entrypoint.sh index 8622856..5a27064 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -36,6 +36,12 @@ find_and_check_files() { while IFS= read -r -d '' file; do format_diff "$file" done < <(find "$include_paths" "${exclude_paths[@]/#/-path }" -prune -o -name '*.h' -print0 -o -name '*.cpp' -print0) + local find_status=$? + + if [[ "${find_status}" -ne 0 ]]; then + echo "Find command failed with status ${find_status}" + exit_code=1 # Indicate that an issue was found + fi } # Main execution