Skip to content

Commit f239ec3

Browse files
committed
deploy(link-check): be careful to anchor the remap patterns
Especially the first one, which typically starts with `(https://<username>.github.io/)?/git-scm.com)`, needs to be anchored to the beginning of the link, otherwise `/git-scm.com` would be matched even in the middle of any link, which was not intended (because the replacement starts with `file:/` and hence must be anchored at the start. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 0c9a959 commit f239ec3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ runs:
131131
shell: bash
132132
run: |
133133
echo "result=$(echo "$base_url" |
134-
sed 's|^\(.*\)\(/git-scm\.com\)$|(\1)?\2(.*)|') file://$PWD/public\$2" \
134+
sed 's|^\(.*\)\(/git-scm\.com\)$|^(\1)?\2(.*)|') file://$PWD/public\$2" \
135135
>>$GITHUB_OUTPUT
136136
# When running in forks, do detect when links try to break out of the
137137
# `/git-scm.com/` subdirectory
138138
echo "remap-dotdot=$(echo "$base_url" |
139-
sed -n 's|^\(https\?:\/\/.*\)\(/git-scm\.com\)$|--remap '\''(\1.*) file://../$1'\''|p')" \
139+
sed -n 's|^\(https\?:\/\/.*\)\(/git-scm\.com\)$|--remap '\''^(\1.*) file://../$1'\''|p')" \
140140
>>$GITHUB_OUTPUT
141141
142142
- name: check for downgrades to unencrypted HTTP

0 commit comments

Comments
 (0)