diff --git a/ci-scripts/report-size.sh b/ci-scripts/report-size.sh index ac61e64..cec3e58 100755 --- a/ci-scripts/report-size.sh +++ b/ci-scripts/report-size.sh @@ -1,6 +1,6 @@ #!/bin/sh -create_table() { +package_size_table() { packages=$(nix flake show --json 2>/dev/null | jq --raw-output '.packages."x86_64-linux" | ".#" + keys[]') # we want to split the words as each of them is a different installable # shellcheck disable=SC2086 @@ -19,7 +19,18 @@ create_table() { if [ "$CI" = "true" ]; then tea login add --url "$GITHUB_SERVER_URL" --token "$GITHUB_TOKEN" - tea pulls list -fi + pr_index=$(tea pulls -f index,head -o simple | grep "$GITHUB_HEAD_REF" | head -n1 | cut -d' ' -f 1) + tea comment "$pr_index" "$( + cat <<-EOF + ### NixOS Configurations sizes -create_table + TODO + + ### Package sizes + + $(package_size_table) + EOF + )" +else + package_size_table +fi