From f0de677b6984c5b2f82ea1cf29df88f493dd704b Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Mon, 5 May 2025 22:31:31 +0100 Subject: [PATCH] Add validation for benchmark report zip file and list directory contents --- .github/workflows/docs-and-testcov.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs-and-testcov.yml b/.github/workflows/docs-and-testcov.yml index cef1082..215926c 100644 --- a/.github/workflows/docs-and-testcov.yml +++ b/.github/workflows/docs-and-testcov.yml @@ -118,13 +118,16 @@ jobs: curl -L -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ -o benchmark-report.zip "$artifact_url" - - # check if there is a benchmark-report.zip file - if [ ! -f benchmark-report.zip ]; then - echo "benchmark-report.zip not found!" + # check if the zip file is valid + if ! unzip -tq benchmark-report.zip; then + echo "benchmark-report.zip is invalid or corrupted!" exit 1 fi - + + # Print all files in the current directory + echo "Files in the current directory:" + ls -al + unzip benchmark-report.zip -d benchmark-report # there will be a tar file in the benchmark-report directory # called artifact.tar. unzip it into the benchmark-report