Skip to content

Commit 2b4aea9

Browse files
committed
deploy: work around the grayed out "Enforce HTTPS" checkbox
We do want to enforce HTTPS. And we kind of do, but not "kind of" enough for GitHub's UI at https://github.com/git/git-scm.com/settings/pages to allow us to check the box called "Enforce HTTPS". The helpful comment next to the grayed out box says: [ ] **Enforce HTTPS** --- Unavailable for your site because your domain is not properly configured to support HTTPS ([`git-scm.com`](http://git-scm.com/)) --- [Troubleshooting custom domains](https://docs.github.com/articles/troubleshooting-custom-domains/#https-errors) HTTPS provides a layer of encryption that prevents others from snooping on or tampering with traffic to your site. When HTTPS is enforced, your site will only be served over HTTPS. [Learn more about securing your GitHub Pages site with HTTPS](https://docs.github.com/pages/getting-started-with-github-pages/securing-your-github-pages-site-with-https). As discussed in #1953, it would appear to be outside our capabilities to fix this properly, therefore we are unfortunately stuck with hard-coding a work-around: Manually override the http:// URL produced by `actions/configure-pages` with the equivalent https:// one. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 52be752 commit 2b4aea9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ runs:
4747
set -x &&
4848
echo "HUGO_VERSION=$(sed -n 's/^ *hugo_version: *//p' <hugo.yml)" >>$GITHUB_ENV
4949
echo "PAGEFIND_VERSION=$(sed -n 's/^ *pagefind_version: *//p' <hugo.yml)" >>$GITHUB_ENV
50-
echo "BASE_URL=${{ steps.pages.outputs.base_url }}" >>$GITHUB_ENV
50+
BASE_URL=${{ steps.pages.outputs.base_url }}
51+
test http://git-scm.com != "$BASE_URL" || BASE_URL="https://${BASE_URL#http://}"
52+
echo "BASE_URL=$BASE_URL" >>$GITHUB_ENV
5153
5254
- name: install Hugo ${{ env.HUGO_VERSION }}
5355
shell: bash

0 commit comments

Comments
 (0)