fix: evaluate http response code for package existence
Some checks failed
poll-upstream / check (push) Failing after 1s

This commit is contained in:
2026-04-24 10:45:27 +03:00
parent a598048fd9
commit 429bcbccb6

View File

@@ -25,10 +25,20 @@ jobs:
# Query our own dnf repo. If the version is there, we've already built it.
# Strip leading 'v' because RPM versions don't use it.
version="${UPSTREAM_TAG#v}"
if curl --fail --silent --show-error --head --url "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-${version}-1.fc43.x86_64.rpm" | grep -q '^HTTP.*200'; then
http_response_code=$(curl \
--fail \
--silent \
--write-out "%{http_code}" \
--output /dev/null \
--head \
--url "https://rpm.lair.cafe/fedora/43/x86_64/mistralrs-server-cuda13-${version}-1.fc43.x86_64.rpm")
if [ "${http_response_code}" = "200" ]; then
echo "already_built=true" >> "$GITHUB_OUTPUT"
else
elif [ "${http_response_code}" = "404" ]; then
echo "already_built=false" >> "$GITHUB_OUTPUT"
else
echo "Unexpected HTTP response code: ${http_response_code}"
exit 1
fi
env:
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}