github actions: ignore timeout when publishing repo changes
This commit is contained in:
parent
2c8431fefb
commit
f7045ad7c5
32
.github/workflows/packages.yml
vendored
32
.github/workflows/packages.yml
vendored
@ -249,25 +249,23 @@ jobs:
|
|||||||
|
|
||||||
# Final part to make changes appear in web root.
|
# Final part to make changes appear in web root.
|
||||||
echo "[*] Publishing repository changes..."
|
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=$(
|
if [ "$exit_code" = 0 ]; then
|
||||||
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
|
|
||||||
echo "[*] Repository updated successfully."
|
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
|
else
|
||||||
# Note: may return error 500 if gpg signing failed.
|
echo "[!] curl exited with error code $exit_status."
|
||||||
echo "[*] Server returned $http_status_code."
|
exit "$exit_code"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user