Public Access
fix(ci): replace missing_links python heredoc with bash loop
Universal: Cascade Main → Dev / Cascade main → branches (push) Failing after 1s
Universal: Cascade Main → Dev / Cascade main → branches (push) Failing after 1s
Second heredoc also incompatible with act runner. Authored-by: Moko Consulting
This commit is contained in:
@@ -608,8 +608,24 @@ jobs:
|
||||
fi
|
||||
|
||||
if [ -f "${DOCS_INDEX}" ]; then
|
||||
missing_links="$(python3 - <<'PY'
|
||||
import os
|
||||
missing_links=""
|
||||
if [ -f "${DOCS_INDEX}" ]; then
|
||||
while IFS= read -r line; do
|
||||
for link in $(echo "$line" | grep -oP '\]\(\K[^)]+' || true); do
|
||||
case "$link" in http://*|https://*|\#*|mailto:*) continue ;; esac
|
||||
linkpath="${link%%#*}"
|
||||
linkpath="${linkpath%%\?*}"
|
||||
[ -z "$linkpath" ] && continue
|
||||
if [ "${linkpath:0:1}" = "/" ]; then
|
||||
testpath="${linkpath#/}"
|
||||
else
|
||||
testpath="$(dirname "${DOCS_INDEX}")/${linkpath}"
|
||||
fi
|
||||
[ ! -e "$testpath" ] && missing_links="${missing_links}${testpath}
|
||||
"
|
||||
done
|
||||
done < "${DOCS_INDEX}"
|
||||
fi
|
||||
import re
|
||||
|
||||
idx = os.environ.get('DOCS_INDEX', 'docs/docs-index.md')
|
||||
|
||||
Reference in New Issue
Block a user