From 4c3c177ecfe315bb3bedc3af69aeb8fc33654c8c Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Fri, 13 Jun 2025 17:37:46 +0200 Subject: [PATCH] Fix a minor security issue (#38815) fix Co-authored-by: ydshieh --- utils/check_self_hosted_runner.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/utils/check_self_hosted_runner.py b/utils/check_self_hosted_runner.py index 7439bd270ef..9c2bfb1f87b 100644 --- a/utils/check_self_hosted_runner.py +++ b/utils/check_self_hosted_runner.py @@ -6,10 +6,15 @@ import subprocess def get_runner_status(target_runners, token): offline_runners = [] - cmd = ( - f'curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer {token}"' - " https://api.github.com/repos/huggingface/transformers/actions/runners" - ) + cmd = [ + "curl", + "-H", + "Accept: application/vnd.github+json", + "-H", + f"Authorization: Bearer {token}", + "https://api.github.com/repos/huggingface/transformers/actions/runners", + ] + output = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE) o = output.stdout.decode("utf-8") status = json.loads(o)