Compare commits

..

1 commit

Author SHA1 Message Date
c17d7c4c36
wip: report package sizes
All checks were successful
/ report-size (pull_request) Successful in 26s
Added as a comment to the current pull request
2024-12-15 11:35:07 +01:00

View file

@ -25,19 +25,22 @@ if [ "$CI" = "true" ]; then
echo "Retrieved index: $pr_number" echo "Retrieved index: $pr_number"
echo "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_number" echo "Expected PR URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/pulls/$pr_number"
echo "Logging in to $GITHUB_SERVER_URL with default token" comment=$(
tea login add --url "$GITHUB_SERVER_URL" --token "$GITHUB_TOKEN"
tea comment "$pr_number" "$(
cat <<-EOF cat <<-EOF
### NixOS Configurations sizes ### NixOS Configurations sizes
TODO TODO
### Package sizes ### Package sizes
$(package_size_table) $(package_size_table)
EOF EOF
)" )
echo "Posting comment: $comment"
curl -X 'POST' \
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$pr_number/comments?token=$GITHUB_TOKEN" \
-H 'accept: application/json' \
-d "$(echo '{}' | jq --arg comment "$comment" '.body=$comment')"
else else
package_size_table package_size_table
fi fi