Skip to content

Commit

Permalink
deploy: fix bogus link check for ../-style links
Browse files Browse the repository at this point in the history
In 72d3f4f (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 <[email protected]>
  • Loading branch information
dscho committed Oct 9, 2024
1 parent a27ad42 commit e857def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/deploy-to-github-pages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e857def

Please sign in to comment.