From 6f286067a422b62de765a14f6f7c708dbf7ca9f8 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:18:46 -0400 Subject: [PATCH] CI: workaround regression in speed in shlink short-url list function --- .github/workflows/create_shlink_links.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_shlink_links.yml b/.github/workflows/create_shlink_links.yml index 4cd6ebe2eb..0e712b0ed2 100644 --- a/.github/workflows/create_shlink_links.yml +++ b/.github/workflows/create_shlink_links.yml @@ -24,14 +24,17 @@ jobs: SHLINK_KEY: ${{ secrets.SHLINK_KEY }} run: | # get all available URLs - curl -X 'GET' --resolve pi-apps-analytics.linkpc.net:443:132.145.164.141 \ - 'https://pi-apps-analytics.linkpc.net/rest/v2/short-urls?itemsPerPage=0' \ + page_number="$(curl -s -X 'GET' --resolve pi-apps-analytics.linkpc.net:443:132.145.164.141 \ + 'https://pi-apps-analytics.linkpc.net/rest/v2/short-urls?itemsPerPage=10' \ -H 'accept: application/json' \ - -H "X-Api-Key: $SHLINK_KEY" - online_shortcodes="$(curl -s -X 'GET' --resolve pi-apps-analytics.linkpc.net:443:132.145.164.141 \ - 'https://pi-apps-analytics.linkpc.net/rest/v2/short-urls?itemsPerPage=0' \ - -H 'accept: application/json' \ - -H "X-Api-Key: $SHLINK_KEY" | jq -r '( .shortUrls | .data | .[] | .shortCode )')" + -H "X-Api-Key: $SHLINK_KEY" | jq -r '( .shortUrls | .pagination | .pagesCount )')" + for ((i = 1 ; i <= $page_number ; i++ )); do + echo "Obtaining page #$i" + online_shortcodes+="$(curl -s -X 'GET' --resolve pi-apps-analytics.linkpc.net:443:132.145.164.141 \ + "https://pi-apps-analytics.linkpc.net/rest/v2/short-urls?itemsPerPage=10&page=$i" \ + -H 'accept: application/json' \ + -H "X-Api-Key: $SHLINK_KEY" | jq -r '( .shortUrls | .data | .[] | .shortCode )')" + done echo "Online shortcodes: $online_shortcodes" #create links applist="$(ls $GITHUB_WORKSPACE/apps | grep .)"