Skip to content

Commit 0342bcd

Browse files
author
Henry Wallace
committed
ci: tolerate crates.io 404 in validation
1 parent 042e411 commit 0342bcd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/publish-validation.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,20 @@ jobs:
2424
run: |
2525
python3 - <<'PY'
2626
import json
27+
import urllib.error
2728
import urllib.request
2829
2930
name = "fynch"
3031
url = f"https://crates.io/api/v1/crates/{name}"
3132
try:
3233
with urllib.request.urlopen(url, timeout=10) as resp:
3334
data = json.load(resp)
35+
except urllib.error.HTTPError as e:
36+
if e.code == 404:
37+
print(f"crates.io: {name} not found (ok for first publish)")
38+
raise SystemExit(0)
39+
print(f"crates.io query failed for {name}: HTTP {e.code}: {e}")
40+
raise SystemExit(1)
3441
except Exception as e:
3542
print(f"crates.io query failed for {name}: {e}")
3643
raise SystemExit(1)

0 commit comments

Comments
 (0)