Skip to content

Commit

Permalink
fix: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaircloth-splunk committed Jan 20, 2022
1 parent bcf66e4 commit 156ebab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion compare_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def compare(
if os.path.isfile(vetting_file):
with open(vetting_file) as f:
vetting_data = yaml.safe_load(f)
if len(vetting_data):
if len(vetting_data) == 0:
if manual_checks:
print(
f"{BCOLORS.WARNING}{BCOLORS.BOLD}{vetting_file} is empty. You can initilize it with below yaml content."
Expand Down
18 changes: 8 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,14 @@ python3 /reporter.py $INPUT_RESULT_FILE
test_exit_code=$?
echo "::endgroup::"

if [ $test_exit_code != 0 ]; then
echo "::group::manual_checks"
python3 /compare_checks.py $INPUT_APP_VETTING $INPUT_RESULT_FILE
test_exit_code=$?
if [ $test_exit_code == 0 ]; then
echo "successful comparison, generating markdown"
echo "/export_to_markdown.py $INPUT_APP_VETTING $INPUT_MANUAL_CHECK_MARKDOWN"
python3 /export_to_markdown.py $INPUT_APP_VETTING $INPUT_MANUAL_CHECK_MARKDOWN
fi
echo "::endgroup::"
echo "::group::manual_checks"
python3 /compare_checks.py $INPUT_APP_VETTING $INPUT_RESULT_FILE
check_exit_code=$?
if [ $check_exit_code == 0 ]; then
echo "successful comparison, generating markdown"
echo "/export_to_markdown.py $INPUT_APP_VETTING $INPUT_MANUAL_CHECK_MARKDOWN"
python3 /export_to_markdown.py $INPUT_APP_VETTING $INPUT_MANUAL_CHECK_MARKDOWN
fi
echo "::endgroup::"

exit "$test_exit_code"

0 comments on commit 156ebab

Please sign in to comment.