Skip to content

Commit bc0fdbf

Browse files
committed
fix(ci): fix check-links querying wrong host
For reasons I don't understand, something changed on CI which makes our server only listen on IPv6 (localhost is ::1) and our check-links.mjs client only connect on IPv4 (localhost is 127.0.0.1). This causes our website job to fail. Work around this issue by explicitly using an address (::1 in this case) instead of writing 'localhost'.
1 parent 1fb746e commit bc0fdbf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/build-website.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ jobs:
5555

5656
- name: check links (dev)
5757
run: |
58+
# HACK(strager): We write "::1" instead of "localhost" because the
59+
# latter listens on IPv6 but connects on IPv4 for some reason.
60+
5861
server_process_is_alive() {
5962
kill -0 "${server_pid}"
6063
}
6164
http_server_is_running() {
6265
curl_status=0
63-
curl --no-progress-meter --head -o /dev/null 'http://localhost:9001/' || curl_status="${?}"
66+
curl --no-progress-meter --head -o /dev/null 'http://[::1]:9001/' || curl_status="${?}"
6467
if [ "${curl_status}" -eq 7 ]; then # 7 is 'Failed to connect to host.'
6568
return 1
6669
fi
@@ -69,14 +72,14 @@ jobs:
6972
7073
set -x
7174
cd website/
72-
yarn start localhost 9001 &
75+
yarn start ::1 9001 &
7376
server_pid="${!}"
7477
cd ../
7578
7679
while server_process_is_alive && ! http_server_is_running; do
7780
sleep 0.1
7881
done
79-
./website/tools/check-links.mjs http://localhost:9001/
82+
./website/tools/check-links.mjs http://[::1]:9001/
8083
kill "${server_pid}"
8184
shell: bash
8285

0 commit comments

Comments
 (0)