From 3e8e71f8b68f9ea843f57f5bebb9aad32700e0ac Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 23 Sep 2024 10:56:10 +0200 Subject: [PATCH] fix(ci): fixup checksum scanning pipeline (#3631) Signed-off-by: Ettore Di Giacinto --- .github/check_and_update.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/check_and_update.py b/.github/check_and_update.py index dcf1d04a..704b658e 100644 --- a/.github/check_and_update.py +++ b/.github/check_and_update.py @@ -29,9 +29,14 @@ def calculate_sha256(file_path): def manual_safety_check_hf(repo_id): scanResponse = requests.get('https://huggingface.co/api/models/' + repo_id + "/scan") scan = scanResponse.json() - if scan['hasUnsafeFile']: - return scan - return None + # Check if 'hasUnsafeFile' exists in the response + if 'hasUnsafeFile' in scan: + if scan['hasUnsafeFile']: + return scan + else: + return None + else: + return None download_type, repo_id_or_url = parse_uri(uri)