Actor: Adding input document URL validation

Signed-off-by: Václav Vančura <commit@vancura.dev>
This commit is contained in:
Václav Vančura 2025-02-05 10:53:56 +01:00 committed by Adam Kliment
parent 1ba5aeefdc
commit 39bcc52c1b

View File

@ -58,6 +58,14 @@ case "$OUTPUT_FORMAT" in md | json | html | text | doctags) ;;
;;
esac
# Validate URL is accessible.
echo "Validating document URL..."
if ! curl --output /dev/null --silent --head --fail "${DOCUMENT_URL}"; then
echo "Error: Unable to access document at URL: ${DOCUMENT_URL}"
echo "Please ensure the URL is valid and publicly accessible."
exit 1
fi
# --- Build Docling command ---
DOC_CONVERT_CMD="docling --verbose \"${DOCUMENT_URL}\" --to \"${OUTPUT_FORMAT}\""