ci: check README links against local website build in CI
README links to hydro.run were not validated in CI, and when validated externally, checked against the live site instead of the PR's changes. This prevented catching broken links when the README and website changed together in the same PR.
Changes
-
scripts/check_readme_links.sh: Extractshydro.runURLs from README and validates each against the localdocs/buildoutput- Maps URLs to filesystem paths:
https://hydro.run/docs/hydro/→docs/build/docs/hydro/index.html - Handles static files (PDFs), pages with/without trailing slashes
- Exits non-zero if any link is broken
- Maps URLs to filesystem paths:
-
.github/workflows/build-website.yml: Added link validation step after website build
$ bash scripts/check_readme_links.sh
Checking README links against local website build...
✓ https://hydro.run
✓ https://hydro.run/docs/hydro/
✗ https://hydro.run/docs/missing-page
Expected file: docs/build/docs/missing-page/index.html
Checked 3 links
ERROR: 1 link(s) failed validation
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
rustwasm.github.io
- Triggering command:
curl REDACTED -sSf(dns block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
Original prompt
This section details on the original issue you should resolve
<issue_title>Test README for broken links in CI job for website</issue_title> <issue_description>We should check the links against the build of the website from the CI job, instead of
https://hydro.run, since we might change the website and the README in the same PR. Can probably extract the README links forhydro.run, extract the path from the URL, and check that it exists in the local website build.</issue_description>Comments on the Issue (you are @copilot in this section)
- Fixes hydro-project/hydro#2237
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Deploying hydro with
Cloudflare Pages
| Latest commit: |
de00279
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a527ba51.hydroflow.pages.dev |
| Branch Preview URL: | https://copilot-test-readme-links-ci.hydroflow.pages.dev |
Actually I guess we need to test against the local website build