Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/manual_reports_to_s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading