diff --git a/ci-scripts/report-size.sh b/ci-scripts/report-size.sh index d85cdbb..242f5de 100755 --- a/ci-scripts/report-size.sh +++ b/ci-scripts/report-size.sh @@ -1,7 +1,10 @@ #!/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 @@ -17,7 +20,7 @@ package_size_table() { EOF } -if [ "$CI" = "true" ]; then +if [ "${CI-false}" = "true" ]; then pr_number=$(curl -X 'GET' \ "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \ -H 'accept: application/json' | @@ -42,8 +45,9 @@ if [ "$CI" = "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?token=$GITHUB_TOKEN" \ + "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$pr_number/comments" \ -H 'accept: application/json' \ + -H "Authorization: token $GITHUB_TOKEN" \ -H 'Content-Type: application/json' \ -d "$data" else