From 7cc7a6f6f4bf4702709c97bdd656e248841ddea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 18 Dec 2024 14:51:45 +0100 Subject: [PATCH] fix(action): artifact is gzip compressed This is not reported to cURL however T-T --- action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3260be1..6ca1dca 100644 --- a/action.yml +++ b/action.yml @@ -79,15 +79,22 @@ runs: } # USAGE: has_report has_report() { - http_code=$(curl -X 'GET' -o /dev/null --silent -Iw '%{http_code}' "$1/artifacts/$ARTIFACT_NAME") + http_code=$(curl -X 'GET' -o /dev/null --silent -Iw '%{http_code}' \ + -H "Authorization: token $GITHUB_TOKEN" \ + "$1/artifacts/$ARTIFACT_NAME") test "$http_code" = '200' } # If we have a previous report compare against it if [ "$JOB_NAME" ] && [ "$HEAD_BRANCH" ]; then url=$(base_report_url) + echo "Found previous run at: $url" if has_report "$url"; then - curl -X 'GET' -o old-report.json "$url/artifacts/$ARTIFACT_NAME" + curl -X 'GET' \ + -H "Authorization: token $GITHUB_TOKEN" \ + "$url/artifacts/$ARTIFACT_NAME" | + gunzip > old-report.json + echo 'Found previous report' "$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json exit 0 fi -- 2.47.0