fix: invalid API url
I misstyped the API URL T-T
This commit is contained in:
parent
73142cfab8
commit
0a637165fe
3 changed files with 33 additions and 24 deletions
|
@ -39,38 +39,47 @@ has_elements() {
|
|||
# If BASE_REPORT is provided, a comparison will be made
|
||||
markdown_from_report() {
|
||||
cat <<-"EOF"
|
||||
<!-- AUTOGENERATED by nix-flake-outputs-size action -->
|
||||
<!-- AUTOGENERATED by nix-flake-outputs-size action -->
|
||||
|
||||
# Flake output sizes
|
||||
## Flake output sizes
|
||||
|
||||
**Definitions:**
|
||||
<details><summary><b>Definitions</b></summary>
|
||||
|
||||
- `Name`: the name of the package/configuration.
|
||||
- `Size`: the closure size (size on disk/NAR size + all transitive dependencies).
|
||||
- `NAR Size`: the size of the build output (package without the dependencies).
|
||||
- `Name`: the name of the package/configuration.
|
||||
- `Size`: the closure size (size on disk/NAR size + all transitive dependencies).
|
||||
- `NAR Size`: the size of the build output (package without the dependencies).
|
||||
EOF
|
||||
if [ "${2+set}" = "set" ]; then
|
||||
cat <<-"EOF"
|
||||
- `[NAR] Size Change`: the amount changed compared to the main branch.
|
||||
- `[NAR] Size Change`: the amount changed compared to the main branch.
|
||||
|
||||
</details>
|
||||
EOF
|
||||
else
|
||||
cat <<-"EOF"
|
||||
</details>
|
||||
EOF
|
||||
fi
|
||||
cat <<-"EOF"
|
||||
|
||||
**Tips on reading this data:**
|
||||
<details><summary><b>Tips on reading this data</b></summary>
|
||||
|
||||
- For NixOS configurations you generally care only about the `Size` (closure size/size on disk).
|
||||
- Reduce the `Size` by disabling unneeded services/default packages.
|
||||
- For Packages you care about both the `Size` and the `NAR Size`.
|
||||
- Reduce the `NAR Size` by reducing the size of the build outputs, e.g. don't copy unnecessary data to the $out dir, optimize binaries for size, etc.
|
||||
- Reduce the `Size` by reducing the dependencies (e.g. `buildInputs`).
|
||||
- Don't worry too much about size, some dependencies are deduplicated, e.g. `glibc` adds ~40MiB to the `Size`, but is generally shared by ~every binary on the system, so, chances are, you are already including it from somewhere else and statically linking with e.g. `musl` is not gonna improve things.
|
||||
|
||||
</details>
|
||||
|
||||
- For NixOS configurations you generally care only about the `Size` (closure size/size on disk).
|
||||
- Reduce the `Size` by disabling unneeded services/default packages.
|
||||
- For Packages you care about both the `Size` and the `NAR Size`.
|
||||
- Reduce the `NAR Size` by reducing the size of the build outputs, e.g. don't copy unnecessary data to the $out dir, optimize binaries for size, etc.
|
||||
- Reduce the `Size` by reducing the dependencies (e.g. `buildInputs`).
|
||||
- Don't worry too much about size, some dependencies are deduplicated, e.g. `glibc` adds ~40MiB to the `Size`, but is generally shared by ~every binary on the system, so, chances are, you are already including it from somewhere else and statically linking with e.g. `musl` is not gonna improve things.
|
||||
EOF
|
||||
|
||||
if [ "${2+set}" = "set" ]; then
|
||||
compare=$(jq --slurp --from-file "${GITHUB_ACTION_PATH:-.}/compare.jq" "$1" "$2")
|
||||
if echo "$compare" | has_elements 'nixosConfigurations'; then
|
||||
cat <<-"EOF"
|
||||
# NixOS Configurations
|
||||
## NixOS Configurations
|
||||
|
||||
| Name | Size | Size Change | NAR Size | NAR Size Change |
|
||||
|------|-----:|------------:|---------:|----------------:|
|
||||
|
@ -80,7 +89,7 @@ markdown_from_report() {
|
|||
fi
|
||||
if echo "$compare" | has_elements 'packages'; then
|
||||
cat <<-"EOF"
|
||||
# Packages
|
||||
## Packages
|
||||
|
||||
| Name | Size | Size Change | NAR Size | NAR Size Change |
|
||||
|------|-----:|------------:|---------:|----------------:|
|
||||
|
@ -91,7 +100,7 @@ markdown_from_report() {
|
|||
else
|
||||
if has_elements 'nixosConfigurations' "$1"; then
|
||||
cat <<-"EOF"
|
||||
# NixOS Configurations
|
||||
## NixOS Configurations
|
||||
|
||||
| Name | Size | NAR Size |
|
||||
|------|-----:|---------:|
|
||||
|
@ -101,7 +110,7 @@ markdown_from_report() {
|
|||
fi
|
||||
if has_elements 'packages' "$1"; then
|
||||
cat <<-"EOF"
|
||||
# Packages
|
||||
## Packages
|
||||
|
||||
| Name | Size | NAR Size |
|
||||
|------|-----:|---------:|
|
||||
|
@ -140,15 +149,15 @@ if [ -z "$COMMENT_ID" ]; then
|
|||
log 'Posting new comment'
|
||||
curl -o - -X 'POST' \
|
||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments" \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Accept: application/json' \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "$data"
|
||||
else
|
||||
log "Editing comment $COMMENT_ID"
|
||||
curl -o - -X 'PATCH' \
|
||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments/$COMMENT_ID" \
|
||||
-H 'accept: application/json' \
|
||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID" \
|
||||
-H 'Accept: application/json' \
|
||||
-H "Authorization: token $GITHUB_TOKEN" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d "$data"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue