Skip to content

Commit 969d67e

Browse files
committed
deploy(link-check): verify absolute git-scm.com links also in forks
When deploying in forks, the base URL is distinctly different from https://git-scm.com. But there are plenty of such links in the HTML pages, e.g. all of those links in the ProGit book that point to Git's homepage. Let's include those in the checks so that broken links are noticed earlier rather than later. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f239ec3 commit 969d67e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/actions/deploy-to-github-pages/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ runs:
138138
echo "remap-dotdot=$(echo "$base_url" |
139139
sed -n 's|^\(https\?:\/\/.*\)\(/git-scm\.com\)$|--remap '\''^(\1.*) file://../$1'\''|p')" \
140140
>>$GITHUB_OUTPUT
141+
# When running in forks, do treat https://git-scm.com links as if they were relative
142+
test https://git-scm.com = "$base_url" ||
143+
echo "remap-git-scm=--remap '^https?://git-scm.com(.*) file://$PWD/public\$1'" >>$GITHUB_OUTPUT
141144
142145
- name: check for downgrades to unencrypted HTTP
143146
if: startsWith(env.base_url, 'https://')
@@ -163,6 +166,7 @@ runs:
163166
--base '${{ env.base_url }}'
164167
--remap '${{ steps.remap.outputs.result }}'
165168
${{ steps.remap.outputs.remap-dotdot }}
169+
${{ steps.remap.outputs.remap-git-scm }}
166170
--exclude file:///path/to/repo.git/
167171
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
168172
--exclude file:///ruta/a/repositorio.git/

0 commit comments

Comments
 (0)