From 1a35d2df15ec5279385fe1715af5606c49775415 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Thu, 22 May 2025 19:35:35 +0300 Subject: [PATCH] fix(deploy): Increase page limit and add pagination to releases --- tools/config.sh | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/tools/config.sh b/tools/config.sh index 79d4feef..4f17d8a1 100755 --- a/tools/config.sh +++ b/tools/config.sh @@ -108,7 +108,7 @@ function github_get_libs_idf(){ # github_get_libs_idf local version_found="" local libs_version="" - while [[ "$libs_version" == "" && "$page" -le 3 ]]; do + while [[ "$libs_version" == "" && "$page" -le 5 ]]; do # Get the latest commit message that matches the prefix and extract the hash from the last commit message version_found=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/commits?sha=$branch_name&per_page=100&page=$page" | \ jq -r --arg prefix "$message_prefix" '[ .[] | select(.commit.message | test($prefix + " [a-f0-9]{8}")) ][0] | .commit.message' | \ @@ -131,7 +131,7 @@ function github_commit_exists(){ #github_commit_exists local page=1 local commits_found=0 - while [ "$page" -le 3 ]; do + while [ "$page" -le 5 ]; do local response=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/commits?sha=$branch_name&per_page=100&page=$page"` if [[ -z "$response" || "$response" == "[]" ]]; then @@ -178,16 +178,52 @@ function github_pr_exists(){ # github_pr_exists function github_release_id(){ # github_release_id local repo_path="$1" local release_tag="$2" - local release=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/releases" | jq --arg release_tag "$release_tag" -r '.[] | select(.tag_name == $release_tag) | .id'` - if [ ! "$release" == "" ] && [ ! "$release" == "null" ]; then echo "$release"; else echo ""; fi + local page=1 + local release_id="" + + while [[ "$page" -le 3 ]]; do + local response=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/releases?per_page=100&page=$page"` + + if [[ -z "$response" || "$response" == "[]" ]]; then + break + fi + + local release=`echo "$response" | jq --arg release_tag "$release_tag" -r '.[] | select(.tag_name == $release_tag) | .id'` + if [ ! "$release" == "" ] && [ ! "$release" == "null" ]; then + release_id=$release + break + fi + + page=$((page+1)) + done + + echo "$release_id" } function github_release_asset_id(){ # github_release_asset_id local repo_path="$1" local release_id="$2" local release_file="$3" - local release_asset=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/releases/$release_id/assets" | jq --arg release_file "$release_file" -r '.[] | select(.name == $release_file) | .id'` - if [ ! "$release_asset" == "" ] && [ ! "$release_asset" == "null" ]; then echo "$release_asset"; else echo ""; fi + local page=1 + local asset_id="" + + while [[ "$page" -le 5 ]]; do + local response=`curl -s -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" "https://api.github.com/repos/$repo_path/releases/$release_id/assets?per_page=100&page=$page"` + + if [[ -z "$response" || "$response" == "[]" ]]; then + break + fi + + local release_asset=`echo "$response" | jq --arg release_file "$release_file" -r '.[] | select(.name == $release_file) | .id'` + if [ ! "$release_asset" == "" ] && [ ! "$release_asset" == "null" ]; then + asset_id=$release_asset + break + fi + + page=$((page+1)) + done + + echo "$asset_id" } function github_release_asset_upload(){ # github_release_asset_upload pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy