mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-04 21:30:07 +06:00
Fix a minor security issue (#38815)
fix Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
parent
93445aed06
commit
4c3c177ecf
@ -6,10 +6,15 @@ import subprocess
|
|||||||
def get_runner_status(target_runners, token):
|
def get_runner_status(target_runners, token):
|
||||||
offline_runners = []
|
offline_runners = []
|
||||||
|
|
||||||
cmd = (
|
cmd = [
|
||||||
f'curl -H "Accept: application/vnd.github+json" -H "Authorization: Bearer {token}"'
|
"curl",
|
||||||
" https://api.github.com/repos/huggingface/transformers/actions/runners"
|
"-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)
|
output = subprocess.run(cmd, shell=True, stdout=subprocess.PIPE)
|
||||||
o = output.stdout.decode("utf-8")
|
o = output.stdout.decode("utf-8")
|
||||||
status = json.loads(o)
|
status = json.loads(o)
|
||||||
|
Loading…
Reference in New Issue
Block a user