From 1c5e62c7dbfe0d3d8fd3ae5c93696b4b7f210f08 Mon Sep 17 00:00:00 2001 From: lyubick Date: Wed, 15 Nov 2023 13:01:48 +0200 Subject: [PATCH] ISSUE #11: Ignore empty file option added ISSUE #7: All files will be checked before crashing with error --- action.yaml | 4 ++++ validator.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index ad87e1d..1974eda 100644 --- a/action.yaml +++ b/action.yaml @@ -26,6 +26,10 @@ inputs: otherwise empty files will be ignored. required: false default: 'true' + schema-mapping: + description: ... + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' diff --git a/validator.py b/validator.py index e89d925..1c7ff8e 100644 --- a/validator.py +++ b/validator.py @@ -75,5 +75,11 @@ def validate_files(yaml_files: list, json_schema: json): args = sys.argv[1:] schema = load_schema(args[0]) - files = get_yaml_json_files_list(args[1], args[2].lower() == 'true') + + files = get_yaml_json_files_list( + files_paths_list=args[1], + is_recursive=args[2].lower() == 'true', + ignore_empty_files=args[3].lower() == 'true' + ) + validate_files(files, schema)