Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ jobs:
root="${BASE%/}/$NAME"
else
root=$(gh api "repos/$REPO/pages" --jq '.html_url' 2>/dev/null || true)
# Checked for SHAPE, not for exit code. With no Pages site `gh api` writes its 404 JSON
# to STDOUT, `--jq` passes it through, and `|| true` hides the failure — measured on
# templateHPC.jl, where the posted link began
# `https://docs.github.com/rest/pages/pages#...","status":"404"}/previews/PR9/`.
case "$root" in https://*) ;; *) root='' ;; esac
# No Pages site yet, or no permission to read it: fall back to the host GitHub would
# serve it from. Lowercased, because the owner may be spelled in mixed case.
[ -n "$root" ] || root="https://$(printf '%s' "$OWNER" | tr '[:upper:]' '[:lower:]').github.io/$NAME"
Expand Down