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