Skip to content

Commit d4f88c1

Browse files
committed
deploy: be more careful when auto-upgrading from HTTP -> HTTPS
Since we play dirty tricks with `/etc/hosts` before running the Playwright tests in order to side-step Cloudflare's caches, we need to avoid using HTTPS for git-scm.com because the certificate would not be liked by Playwright. The symptom is: Error: page.goto: net::ERR_CERT_COMMON_NAME_INVALID at https://git-scm.com/ The most likely explanation is that GitHub, when trying to verify the DNS settings, realizes that the actual DNS entries by Cloudflare do _not_ point to GitHub's servers and therefore refuses to get a custom certificate from Let's Encrypt for git-scm.com. As a consequence, the certificate it provides does not cover that domain, it only covers *.github.io. Let's just leave http://git-scm.com/ alone. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b99865e commit d4f88c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ runs:
196196
PLAYWRIGHT_TEST_URL: ${{ steps.pages.outputs.base_url }}
197197
run: |
198198
# avoid test failures when HTTPS is enforced half-way through
199-
PLAYWRIGHT_TEST_URL="$(echo "$PLAYWRIGHT_TEST_URL" | sed 's/^http:/https:/')" &&
199+
case "$PLAYWRIGHT_TEST_URL" in
200+
https://*|http://git-scm.com/) ;; # okay, leave as-is
201+
http://*) PLAYWRIGHT_TEST_URL="https://${PLAYWRIGHT_TEST_URL#http://}";;
202+
esac &&
200203
npx playwright test --project=chrome
201204
- uses: actions/upload-artifact@v4
202205
if: always()

0 commit comments

Comments
 (0)