diff --git a/ci-scripts/report-size.sh b/ci-scripts/report-size.sh index 242f5de..d85cdbb 100755 --- a/ci-scripts/report-size.sh +++ b/ci-scripts/report-size.sh @@ -1,10 +1,7 @@ #!/bin/sh -set -eu - package_size_table() { packages=$(nix flake show --json 2>/dev/null | jq --raw-output '.packages."x86_64-linux" | ".#" + keys[]') - echo 'Building packages' >&2 # we want to split the words as each of them is a different installable # shellcheck disable=SC2086 nix build $packages @@ -20,7 +17,7 @@ package_size_table() { EOF } -if [ "${CI-false}" = "true" ]; then +if [ "$CI" = "true" ]; then pr_number=$(curl -X 'GET' \ "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \ -H 'accept: application/json' | @@ -45,9 +42,8 @@ if [ "${CI-false}" = "true" ]; then data=$(echo '{}' | jq --arg comment "$comment" '.body=$comment') echo "$data" curl -o - -v -X 'POST' \ - "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$pr_number/comments" \ + "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$pr_number/comments?token=$GITHUB_TOKEN" \ -H 'accept: application/json' \ - -H "Authorization: token $GITHUB_TOKEN" \ -H 'Content-Type: application/json' \ -d "$data" else