fix(ci): Process only needed files in publish sizes (#11439)

This commit is contained in:
Jan Procházka 2025-06-10 09:59:56 +02:00 committed by GitHub
parent ee347baa7d
commit af47bd3008
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,16 +44,17 @@ jobs:
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do do
IFS=$'\t' read name url <<< "$artifact" IFS=$'\t' read name url <<< "$artifact"
# Only process pr_number and pr_cli_compile artifacts
if [[ "$name" == "pr_number" || "$name" =~ ^pr_cli_compile_[0-9]+$ ]]; then
gh api $url > "$name.zip" gh api $url > "$name.zip"
unzip -j "$name.zip" -d "temp_$name" unzip -o -j "$name.zip" -d "temp_$name"
if [[ "$name" == "pr_number" ]]; then if [[ "$name" == "pr_number" ]]; then
mv "temp_$name"/* sizes-report mv "temp_$name"/* sizes-report
elif [[ "$name" == "pr_cli"* ]]; then elif [[ "$name" =~ ^pr_cli_compile_[0-9]+$ ]]; then
mv "temp_$name"/* sizes-report/pr mv "temp_$name"/* sizes-report/pr
else
mv "temp_$name"/* sizes-report
fi fi
rm -r "temp_$name" rm -r "temp_$name"
fi
done done
echo "Contents of parent directory:" echo "Contents of parent directory:"
ls -R .. ls -R ..