From f7045ad7c511fab67999ddb4ca1fcb8efbddae1c Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Fri, 30 Jul 2021 18:06:38 +0300 Subject: [PATCH] github actions: ignore timeout when publishing repo changes --- .github/workflows/packages.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 8fc90d89d..be7dd96b9 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -249,25 +249,23 @@ jobs: # Final part to make changes appear in web root. echo "[*] Publishing repository changes..." + set +e + curl \ + --silent \ + --user "${{ secrets.APTLY_API_AUTH }}" \ + --header 'Content-Type: application/json' \ + --request PUT \ + --data '{"Signing": {"Passphrase": "${{ secrets.GPG_PASSPHRASE }}"}}' \ + https://packages.termux.org/aptly-api/publish/${REPOSITORY_NAME}/${REPOSITORY_DISTRIBUTION} + exit_code=$? - curl_response=$( - curl \ - --silent \ - --user "${{ secrets.APTLY_API_AUTH }}" \ - --header 'Content-Type: application/json' \ - --request PUT \ - --data '{"Signing": {"Passphrase": "${{ secrets.GPG_PASSPHRASE }}"}}' \ - --write-out "|%{http_code}" \ - https://packages.termux.org/aptly-api/publish/${REPOSITORY_NAME}/${REPOSITORY_DISTRIBUTION} - ) - - http_status_code=$(echo "$curl_response" | cut -d'|' -f2) - - if [ "$http_status_code" = "200" ]; then + if [ "$exit_code" = 0 ]; then echo "[*] Repository updated successfully." + elif [ "$exit_code" = 52 ]; then + echo "[!] Repository update takes more time than expected, server returned empty response." + echo "[!] This is expected if large amount of data has been submitted." else - # Note: may return error 500 if gpg signing failed. - echo "[*] Server returned $http_status_code." - exit 1 + echo "[!] curl exited with error code $exit_status." + exit "$exit_code" fi fi