github actions: filter http codes in other places, not only when publishing changes

This commit is contained in:
Leonid Pliushch 2021-12-26 22:40:10 +02:00
parent 1e88cca692
commit 750a529467
No known key found for this signature in database
GPG Key ID: 45F2964132545795
1 changed files with 3 additions and 3 deletions

View File

@ -193,7 +193,7 @@ jobs:
https://packages.termux.org/aptly-api/files/${REPOSITORY_NAME}-${{ github.sha }}
)
http_status_code=$(echo "$curl_response" | cut -d'|' -f2)
http_status_code=$(echo "$curl_response" | cut -d'|' -f2 | grep -oP '\d{3}$')
if [ "$http_status_code" != "200" ]; then
echo "[$(date +%H:%M:%S)] Warning: server returned $http_status_code code while deleting temporary directory."
@ -217,7 +217,7 @@ jobs:
https://packages.termux.org/aptly-api/files/${REPOSITORY_NAME}-${{ github.sha }} || true
)
http_status_code=$(echo "$curl_response" | cut -d'|' -f2)
http_status_code=$(echo "$curl_response" | cut -d'|' -f2 | grep -oP '\d{3}$')
if [ "$http_status_code" = "200" ]; then
echo "[$(date +%H:%M:%S)] Uploaded: $(echo "$curl_response" | cut -d'|' -f1 | jq -r '.[]' | cut -d'/' -f2)"
@ -254,7 +254,7 @@ jobs:
--write-out "|%{http_code}" \
https://packages-cf.termux.org/aptly-api/repos/${REPOSITORY_NAME}/file/${REPOSITORY_NAME}-${{ github.sha }} || true
)
http_status_code=$(echo "$curl_response" | cut -d'|' -f2)
http_status_code=$(echo "$curl_response" | cut -d'|' -f2 | grep -oP '\d{3}$')
if [ "$http_status_code" = "200" ]; then
warnings=$(echo "$curl_response" | cut -d'|' -f1 | jq '.Report.Warnings' | jq -r '.[]')