Skip to content

Commit d874f37

Browse files
committed
ci: check for broken git-scm.com links
Not all links are relative in the PR build; Some of the links originate from Git's manual pages or from the ProGit book or its translations, and those links are of the form "https://git-scm.com/...". Let's map those into "file:///..." URLs so that lychee checks them even in offline mode. This uncovers a broken link which is address by jnavila/git-manpages-l10n#131. For the time being, this patch adds a work-around specifically for that issue lest contributors' PRs fail through no fault of their own. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 969d67e commit d874f37

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,20 @@ jobs:
5858
done
5959
exit $res
6060
61+
- name: work around for broken link
62+
# See https://github.com/jnavila/git-manpages-l10n/pull/131;
63+
# A space is missing in "https://git-scm.com/docs上查看"
64+
run: |
65+
sed -i 's,\(href="\(https://git-scm.com/docs\)\)\(上查看\)"\([^>]*>\)\2\3\(</a>\),\1"\4\1\5 \3,p' \
66+
external/docs/content/docs/git/zh_HANS-CN.html
67+
6168
- name: check for broken links
6269
id: lychee
6370
uses: lycheeverse/lychee-action@v2
6471
with:
6572
args: >-
6673
--offline
74+
--remap '^https?://git-scm.com(.*) file://'"$PWD"'/public$1'
6775
--fallback-extensions html
6876
--exclude file:///path/to/repo.git/
6977
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/

0 commit comments

Comments
 (0)