Skip to content

Commit 88ad648

Browse files
authored
Merge pull request #1957 from dscho/fix-deployment
Fix deployment
2 parents c6a19e3 + b7244a1 commit 88ad648

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ runs:
7474
shell: bash
7575
run: hugo config && hugo --baseURL "${{ env.base_url }}/"
7676

77+
- name: enforce HTTPS in links to git-scm.com from external sources (book, docs, ...)
78+
if: startsWith(env.base_url, 'https://')
79+
shell: bash
80+
run: |
81+
find public/book public/docs -name \*.html -print0 |
82+
xargs -0r sed -i 's,http://git-scm\.com,https://git-scm.com,g'
83+
7784
- name: run Pagefind ${{ env.PAGEFIND_VERSION }} to build the search index
7885
shell: bash
7986
run: npx -y pagefind@${{ env.PAGEFIND_VERSION }} --site public
@@ -141,7 +148,10 @@ runs:
141148
# A simple `grep` should work without any false positives,
142149
# unless git-scm.com mentions the base URL of one of its forks,
143150
# which is unlikely.
144-
run: '! grep -FInr "http:${base_url#https:}" public'
151+
#
152+
# To catch bugs early, let's always look for non-HTTPS links
153+
# to git-scm.com.
154+
run: '! grep -FInre "http://git-scm.com" -e "http:${base_url#https:}" public'
145155

146156
- name: check for broken links
147157
id: lychee

0 commit comments

Comments
 (0)