From e266262b5e20d0ab34909201dc473e5b14a7a0e3 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 9 Sep 2026 09:42:34 +0900 Subject: [PATCH] release: Download large files from Google Drive correctly Google Drive returns a "Google Drive can't scan this file for viruses" confirmation HTML page instead of the file itself for large (100MB+) files. The release job saved that page as the file, so some files in the published archive were HTML pages (e.g. 6 casing STL files in 1.1.0 and 2 STEP files of OpenArm Cell for 2.0). Add "confirm=t" to the download URL to skip the confirmation page. Also detect download failures instead of silently packaging broken files: * Use --fail so that HTTP errors fail the job * Fail the job when Google Drive returns an HTML page (deleted file, no permission and so on) * Log the size of each downloaded file Co-Authored-By: Claude Fable 5.1 --- .github/workflows/release.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a6c1d27..10907cd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -46,10 +46,24 @@ jobs: while IFS=$'\t' read -r id path; do mkdir -p "${name}/$(dirname "${path}")" - curl \ + # "confirm=t" skips the "Google Drive can't scan this file + # for viruses" confirmation page that is returned instead + # of the file itself for large (100MB+) files. + content_type=$(curl \ + --fail \ + --location \ + --show-error \ --silent \ --output "${name}/${path}" \ - "https://drive.usercontent.google.com/download?id=${id}" + --write-out '%{content_type}' \ + "https://drive.usercontent.google.com/download?id=${id}&export=download&confirm=t") + case "${content_type}" in + text/html*) + echo "::error::Failed to download ${path} (${id}): Google Drive returned an HTML page instead of the file" + exit 1 + ;; + esac + echo "Downloaded ${path} ($(stat -c %s "${name}/${path}") bytes)" done < ./dev/google-drive-files/file-ids.tsv tar -czf ${name}.tar.gz ${name}