From 42c4819695a657f9d4236c01882f22f9d443e890 Mon Sep 17 00:00:00 2001 From: Haoxi Tan Date: Tue, 6 Jun 2023 08:49:29 +1000 Subject: [PATCH] fetch all reports --- reports/fetch_all_reports.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 reports/fetch_all_reports.sh diff --git a/reports/fetch_all_reports.sh b/reports/fetch_all_reports.sh new file mode 100755 index 000000000..0d32b3718 --- /dev/null +++ b/reports/fetch_all_reports.sh @@ -0,0 +1,9 @@ +echo 'make sure your GH_TOKEN is set! public repo access is enough to download the artifact.' +URLS=$(curl https://api.github.com/repos/h4sh5/pypi-auto-scanner/actions/artifacts | grep archive_download_url| cut -d '"' -f 4) + +for DL_URL in $URLS +do + echo Downloading from $DL_URL + ARTIFACT_ID=$(echo $DL_URL|cut -d / -f9) + curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GH_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" -o report_${ARTIFACT_ID}.zip "$DL_URL" +done