Skip to content

Commit c22a1a5

Browse files
committed
deploy(playwright): work around externally-enforced HTTPS
It is possible to enforce HTTPS on GitHub Pages, via https://docs.github.com/en/pages/getting-started-with-github-pages/securing-your-github-pages-site-with-https#enforcing-https-for-your-github-pages-site Without this flag enabled, it is still possible to access the site via http:// URLs, otherwise such URLs will automatically redirect to https:// URLs. However, it is also possible to enforce HTTPS e.g. by using a custom domain and putting Cloudflare in front of GitHub Pages. The Playwright tests, which are designed to catch undesired redirects that may, say, drop the `/git-scm.com/` part of the URLs in forks by mistake, are currently not expecting this. Since GitHub Pages supports HTTPS in all cases, and there are no options anywhere to enforce HTTP instead of HTTPS, let's just test with the https:// URL even if no enforcement was configured. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 6740ecc commit c22a1a5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ runs:
194194
shell: bash
195195
env:
196196
PLAYWRIGHT_TEST_URL: ${{ steps.pages.outputs.base_url }}
197-
run: npx playwright test --project=chrome
197+
run: |
198+
# avoid test failures when HTTPS is enforced half-way through
199+
PLAYWRIGHT_TEST_URL="$(echo "$PLAYWRIGHT_TEST_URL" | sed 's/^http:/https:/')" &&
200+
npx playwright test --project=chrome
198201
- uses: actions/upload-artifact@v4
199202
if: always()
200203
with:

0 commit comments

Comments
 (0)