From 3ac3abc7d11bbc5cdce6c0ed114417a3c1585dcf Mon Sep 17 00:00:00 2001 From: Jonathan Miller <1+jmiller@noreply.git.mokoconsulting.tech> Date: Wed, 20 May 2026 02:09:45 +0000 Subject: [PATCH] fix(ci): replace missing_links python heredoc with bash loop Second heredoc also incompatible with act runner. Authored-by: Moko Consulting --- .gitea/workflows/repo-health.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/repo-health.yml b/.gitea/workflows/repo-health.yml index 079d2b6..5c6a513 100644 --- a/.gitea/workflows/repo-health.yml +++ b/.gitea/workflows/repo-health.yml @@ -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')