From e857def6d570249ce3050c2bdc91065879851363 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 9 Oct 2024 18:31:06 +0200 Subject: [PATCH] deploy: fix bogus link check for `../`-style links In 72d3f4f5b (ci(lychee): do detect incorrect `../` links, 2024-10-07), I introduced a somewhat complicated logic to detect bogus `../`-style links like the `link:../howto/maintain-git.txt` one introduced via Git v2.47.0. The main idea was to do introduce the step output `remap-dotdot` which would be only set in forks but not in the main repository. However, due to the buggy implementation, it would be set in the main repository, to: --remap '(http:/.*) file://../$1' ... which basically marked all http:// URLs as broken links. Let's fix that logic so that `remap-dotdot` _is_ empty in the main repository. Signed-off-by: Johannes Schindelin --- .github/actions/deploy-to-github-pages/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/deploy-to-github-pages/action.yml b/.github/actions/deploy-to-github-pages/action.yml index 8b3948c85b..1713f45990 100644 --- a/.github/actions/deploy-to-github-pages/action.yml +++ b/.github/actions/deploy-to-github-pages/action.yml @@ -117,7 +117,7 @@ runs: # When running in forks, do detect when links try to break out of the # `/git-scm.com/` subdirectory echo "remap-dotdot=$(echo "$base_url" | - sed 's|^\(.*\)\(/git-scm\.com\)$|--remap '\''(\1.*) file://../$1'\''|')" \ + sed -n 's|^\(https\?:\/\/.*\)\(/git-scm\.com\)$|--remap '\''(\1.*) file://../$1'\''|p')" \ >>$GITHUB_OUTPUT - name: check for broken links