diff --git a/.github/workflows/manual_reports_to_s3.yml b/.github/workflows/manual_reports_to_s3.yml index 41480d063a..49553495f6 100644 --- a/.github/workflows/manual_reports_to_s3.yml +++ b/.github/workflows/manual_reports_to_s3.yml @@ -70,38 +70,56 @@ jobs: - name: Download report run: | + pip install gdown + # Handle Google Drive links if [[ "${{ inputs.drive_link }}" == *"drive.google.com"* ]]; then - FILE_ID=$(echo "${{ inputs.drive_link }}" | sed -n -e 's/^.*d\/\([^\/]*\)\/.*$/\1/p') - curl -L -o allure-report.zip "https://drive.google.com/uc?export=download&id=${FILE_ID}" || { + + FILE_ID=$(echo "${{ inputs.drive_link }}" | sed -n 's#.*\/d\/\([^/]*\)\/.*#\1#p') + + echo "Downloading Google Drive file: $FILE_ID" + + gdown "https://drive.google.com/uc?id=${FILE_ID}" -O allure-report.zip || { echo "::error::Failed to download from Google Drive" exit 1 } + # Handle OneDrive/SharePoint links elif [[ "${{ inputs.drive_link }}" == *"onedrive.live.com"* ]] || [[ "${{ inputs.drive_link }}" == *"sharepoint.com"* ]]; then - curl -L -o allure-report.zip "${{ inputs.drive_link }}" | sed 's/.*\(https:\/\/[^"]*\).*/\1/' | head -1 | xargs curl -L -o allure-report.zip || { + + curl -L -o allure-report.zip "${{ inputs.drive_link }}" || { echo "::error::Failed to download from OneDrive/SharePoint" exit 1 } + # Handle Dropbox links elif [[ "${{ inputs.drive_link }}" == *"dropbox.com"* ]]; then - curl -L -o allure-report.zip "${url%?dl=0}?dl=1" || { + + DROPBOX_URL=$(echo "${{ inputs.drive_link }}" | sed 's/dl=0/dl=1/') + + curl -L -o allure-report.zip "$DROPBOX_URL" || { echo "::error::Failed to download from Dropbox" exit 1 } - # Handle other direct download links + + # Handle direct links else + curl -L -o allure-report.zip "${{ inputs.drive_link }}" || { echo "::error::Failed to download from provided URL" exit 1 } + fi + echo "Downloaded file details:" + ls -lh allure-report.zip + file allure-report.zip + unzip -t allure-report.zip || { echo "::error::Invalid ZIP file" exit 1 } - - name: Extract report run: | unzip -q allure-report.zip -d temp