fix: invalid API url
I misstyped the API URL T-T
This commit is contained in:
parent
73142cfab8
commit
62ff83fb75
3 changed files with 12 additions and 8 deletions
|
@ -81,7 +81,7 @@ runs:
|
||||||
prs=$(curl -X 'GET' \
|
prs=$(curl -X 'GET' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls?state=open&sort=recentupdate" \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'accept: application/json')
|
-H 'Accept: application/json')
|
||||||
|
|
||||||
pr_number=$(echo "$prs" |
|
pr_number=$(echo "$prs" |
|
||||||
jq --arg head_ref "$head_ref" '.[] | select(.head.ref == $head_ref) | .number')
|
jq --arg head_ref "$head_ref" '.[] | select(.head.ref == $head_ref) | .number')
|
||||||
|
|
|
@ -43,11 +43,13 @@ markdown_from_report() {
|
||||||
|
|
||||||
# Flake output sizes
|
# Flake output sizes
|
||||||
|
|
||||||
**Definitions:**
|
<details><summary><b>Definitions:</b></summary>
|
||||||
|
|
||||||
- `Name`: the name of the package/configuration.
|
- `Name`: the name of the package/configuration.
|
||||||
- `Size`: the closure size (size on disk/NAR size + all transitive dependencies).
|
- `Size`: the closure size (size on disk/NAR size + all transitive dependencies).
|
||||||
- `NAR Size`: the size of the build output (package without the dependencies).
|
- `NAR Size`: the size of the build output (package without the dependencies).
|
||||||
|
|
||||||
|
</details>
|
||||||
EOF
|
EOF
|
||||||
if [ "${2+set}" = "set" ]; then
|
if [ "${2+set}" = "set" ]; then
|
||||||
cat <<-"EOF"
|
cat <<-"EOF"
|
||||||
|
@ -56,7 +58,7 @@ markdown_from_report() {
|
||||||
fi
|
fi
|
||||||
cat <<-"EOF"
|
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).
|
- For NixOS configurations you generally care only about the `Size` (closure size/size on disk).
|
||||||
- Reduce the `Size` by disabling unneeded services/default packages.
|
- Reduce the `Size` by disabling unneeded services/default packages.
|
||||||
|
@ -64,6 +66,8 @@ markdown_from_report() {
|
||||||
- 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 `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`).
|
- 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.
|
- 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>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "${2+set}" = "set" ]; then
|
if [ "${2+set}" = "set" ]; then
|
||||||
|
@ -140,15 +144,15 @@ if [ -z "$COMMENT_ID" ]; then
|
||||||
log 'Posting new comment'
|
log 'Posting new comment'
|
||||||
curl -o - -X 'POST' \
|
curl -o - -X 'POST' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments" \
|
||||||
-H 'accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "$data"
|
-d "$data"
|
||||||
else
|
else
|
||||||
log "Editing comment $COMMENT_ID"
|
log "Editing comment $COMMENT_ID"
|
||||||
curl -o - -X 'PATCH' \
|
curl -o - -X 'PATCH' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/$PR_ID/comments/$COMMENT_ID" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/issues/comments/$COMMENT_ID" \
|
||||||
-H 'accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "$data"
|
-d "$data"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
repo_info() {
|
repo_info() {
|
||||||
curl -X GET \
|
curl -X GET \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY"
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ base_report_url() {
|
||||||
curl -X 'GET' \
|
curl -X 'GET' \
|
||||||
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/tasks" \
|
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/tasks" \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
-H 'accept: application/json' |
|
-H 'Accept: application/json' |
|
||||||
jq --raw-output \
|
jq --raw-output \
|
||||||
--arg name "$JOB_NAME" \
|
--arg name "$JOB_NAME" \
|
||||||
--arg head_branch "$1" \
|
--arg head_branch "$1" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue