Skip to content

Commit 9d981f0

Browse files
committed
Check links with HEAD request
1 parent fc3d683 commit 9d981f0

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/make-tutorials-json.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ jobs:
2525
filter: blob:none
2626
fetch-depth: 0
2727

28-
- uses: actions/setup-python@v5
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v7
2930
with:
30-
python-version: "3.12"
31-
cache: "pip" # caching pip dependencies
32-
- name: Install dependencies for validation script
33-
run: pip install .[registry]
31+
cache-dependency-glob: pyproject.toml
3432
- name: Execute validation script and create output directory
3533
run: |
36-
./tutorial-registry/validate.py --outdir=build
34+
uv run validate --outdir=build
3735
3836
- name: Upload GitHub Pages artifact
3937
uses: actions/upload-pages-artifact@v3

tutorial-registry/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
def _check_url_exists(url: str) -> None:
26-
response = httpx.get(url)
26+
response = httpx.head(url, follow_redirects=True)
2727
if response.status_code != 200:
2828
raise ValueError(f"URL {url} is not reachable (error {response.status_code}). ")
2929

0 commit comments

Comments
 (0)