Skip to content

Commit c902ac8

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 c902ac8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ jobs:
1919
curl -Lo /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v$HUGO_VERSION/hugo_extended_${HUGO_VERSION}_linux-amd64.deb &&
2020
sudo dpkg -i /tmp/hugo.deb
2121
22+
- name: work around a broken link
23+
# See https://github.com/jnavila/git-manpages-l10n/pull/131;
24+
# A space is missing in "https://git-scm.com/docs上查看"
25+
run: |
26+
sed -i 's,\(href="\(https://git-scm.com/docs\)\)\(上查看\)"\([^>]*>\)\2\3\(</a>\),\1"\4\1\5 \3,p' \
27+
external/docs/content/docs/git/zh_HANS-CN.html
28+
2229
- name: run Hugo to build the pages
2330
run: hugo
2431

@@ -64,6 +71,7 @@ jobs:
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)