From c3362d46507094924e22d1861d39becf26847818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 18 Dec 2024 16:18:13 +0100 Subject: [PATCH] fix(action): small typos and weird stuff Why is it not downloading the previous report? --- action.yml | 9 ++++----- comment_on_pr.sh | 4 ++-- create-report.sh | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 7fba491..97868ca 100644 --- a/action.yml +++ b/action.yml @@ -82,9 +82,8 @@ runs: # USAGE: has_report has_report() { http_code=$(curl -X 'GET' -o /dev/null --silent -Iw '%{http_code}' \ - -H "Authorization: token $GITHUB_TOKEN" \ - "$1") - log "Got code $http_code for $url" + "$1" -H "Authorization: token $GITHUB_TOKEN") + log "Got code $http_code for $1" test "$http_code" = '200' } @@ -96,8 +95,8 @@ runs: if has_report "$report_url"; then log 'Found previous report, downloading...' curl -X 'GET' \ - -H "Authorization: token $GITHUB_TOKEN" \ - "$url/artifacts/$ARTIFACT_NAME" | + "$report_url" \ + -H "Authorization: token $GITHUB_TOKEN" | gunzip > old-report.json log "Reporting on sizes and comparing to sizes in $HEAD_BRANCH" "$GITHUB_ACTION_PATH/comment_on_pr.sh" report.json old-report.json diff --git a/comment_on_pr.sh b/comment_on_pr.sh index fee22a9..8c1bf74 100755 --- a/comment_on_pr.sh +++ b/comment_on_pr.sh @@ -126,12 +126,12 @@ log "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_number" log 'Generating comment body' comment=$(markdown_from_report "$@") -group 'Comment Data:' +group 'Comment Data' log "$comment" endgroup data=$(echo '{}' | jq --arg comment "$comment" '.body=$comment') -group 'Request data:' +group 'Request data' log "$data" endgroup diff --git a/create-report.sh b/create-report.sh index b896f5d..abee680 100755 --- a/create-report.sh +++ b/create-report.sh @@ -14,7 +14,7 @@ packages=$( $flake_info EOF ) -group 'Packages:' +group 'Show Packages' log "$packages" endgroup configurations=$( @@ -22,7 +22,7 @@ configurations=$( $flake_info EOF ) -group 'NixOS Configurations:' +group 'Show NixOS Configurations' log "$configurations" endgroup