fix: evaluate http response code for package existence
Some checks failed
poll-upstream / check (push) Failing after 1s
Some checks failed
poll-upstream / check (push) Failing after 1s
This commit is contained in:
@@ -25,10 +25,20 @@ jobs:
|
|||||||
# Query our own dnf repo. If the version is there, we've already built it.
|
# 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.
|
# Strip leading 'v' because RPM versions don't use it.
|
||||||
version="${UPSTREAM_TAG#v}"
|
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"
|
echo "already_built=true" >> "$GITHUB_OUTPUT"
|
||||||
else
|
elif [ "${http_response_code}" = "404" ]; then
|
||||||
echo "already_built=false" >> "$GITHUB_OUTPUT"
|
echo "already_built=false" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "Unexpected HTTP response code: ${http_response_code}"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
|
UPSTREAM_TAG: ${{ steps.upstream.outputs.tag }}
|
||||||
|
|||||||
Reference in New Issue
Block a user