Skip to content

Commit 5667845

Browse files
committed
Update Manual Reports to S3 workflow inorder to work with large files
Signed-off-by: bhargavi-ct <bhargavi.mamidipaka@candelatech.com>
1 parent c3f3b3f commit 5667845

1 file changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/manual_reports_to_s3.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,38 +70,54 @@ jobs:
7070

7171
- name: Download report
7272
run: |
73+
pip install gdown
74+
7375
# Handle Google Drive links
7476
if [[ "${{ inputs.drive_link }}" == *"drive.google.com"* ]]; then
75-
FILE_ID=$(echo "${{ inputs.drive_link }}" | sed -n -e 's/^.*d\/\([^\/]*\)\/.*$/\1/p')
76-
curl -L -o allure-report.zip "https://drive.google.com/uc?export=download&id=${FILE_ID}" || {
77+
78+
FILE_ID=$(echo "${{ inputs.drive_link }}" | sed -n 's#.*\/d\/\([^/]*\)\/.*#\1#p')
79+
80+
echo "Downloading Google Drive file: $FILE_ID"
81+
82+
gdown --id "$FILE_ID" -O allure-report.zip || {
7783
echo "::error::Failed to download from Google Drive"
7884
exit 1
7985
}
86+
8087
# Handle OneDrive/SharePoint links
8188
elif [[ "${{ inputs.drive_link }}" == *"onedrive.live.com"* ]] || [[ "${{ inputs.drive_link }}" == *"sharepoint.com"* ]]; then
82-
curl -L -o allure-report.zip "${{ inputs.drive_link }}" | sed 's/.*\(https:\/\/[^"]*\).*/\1/' | head -1 | xargs curl -L -o allure-report.zip || {
89+
90+
curl -L -o allure-report.zip "${{ inputs.drive_link }}" || {
8391
echo "::error::Failed to download from OneDrive/SharePoint"
8492
exit 1
8593
}
94+
8695
# Handle Dropbox links
8796
elif [[ "${{ inputs.drive_link }}" == *"dropbox.com"* ]]; then
88-
curl -L -o allure-report.zip "${url%?dl=0}?dl=1" || {
97+
98+
curl -L -o allure-report.zip "${{ inputs.drive_link/\?dl=0/?dl=1 }}" || {
8999
echo "::error::Failed to download from Dropbox"
90100
exit 1
91101
}
92-
# Handle other direct download links
102+
103+
# Handle direct links
93104
else
105+
94106
curl -L -o allure-report.zip "${{ inputs.drive_link }}" || {
95107
echo "::error::Failed to download from provided URL"
96108
exit 1
97109
}
110+
98111
fi
99112
113+
echo "Downloaded file details:"
114+
ls -lh allure-report.zip
115+
file allure-report.zip
116+
100117
unzip -t allure-report.zip || {
101118
echo "::error::Invalid ZIP file"
102119
exit 1
103120
}
104-
105121
- name: Extract report
106122
run: |
107123
unzip -q allure-report.zip -d temp

0 commit comments

Comments
 (0)