Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 14 additions & 5 deletions .github/workflows/_visual-regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
container:
image: mcr.microsoft.com/playwright:v1.65.0-noble@sha256:6e3fb709361521eb27161606e6da6d2674e5e89fa16516cb37d6fdd91372273d # v1.63.0-noble
options: --ipc=host
env:
# Keep the build-time MCP metadata format stable. The regular site
# build still validates the current ToolHive release independently.
TOOLHIVE_VERSION: '0.49.0'
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down Expand Up @@ -72,7 +68,20 @@ jobs:
- name: Install ToolHive CLI
env:
TOOLHIVE_VERIFY_SIGNATURE: 'true'
run: ./scripts/install-thv.sh
GITHUB_TOKEN: ${{ github.token }}
# Use the ToolHive release the docs are synced to, so the version
# moves with release sync PRs instead of drifting.
run: |
TOOLHIVE_VERSION="$(node -e '
const fs = require("fs");
const { parse } = require("yaml");
const config = parse(fs.readFileSync(".github/upstream-projects.yaml", "utf8"));
const version = config.projects.find((p) => p.id === "toolhive")?.version;
if (!version) throw new Error("No toolhive version in upstream-projects.yaml");
console.log(version);
')"
export TOOLHIVE_VERSION
./scripts/install-thv.sh

# SWC's native loader rejects the writable parents of /github/home.
# Use a private cache under /tmp, whose sticky bit protects its children.
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/update-visual-baselines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ concurrency:
permissions:
contents: read

env:
# Must match _visual-regression.yaml so baseline generation and comparison
# use the same build-time MCP metadata format.
TOOLHIVE_VERSION: '0.49.0'

jobs:
authorize:
name: Authorize the request
Expand Down Expand Up @@ -108,7 +103,20 @@ jobs:
- name: Install ToolHive CLI
env:
TOOLHIVE_VERIFY_SIGNATURE: 'true'
run: ./scripts/install-thv.sh
GITHUB_TOKEN: ${{ github.token }}
# Use the ToolHive release the docs are synced to, so the version
# moves with release sync PRs instead of drifting.
run: |
TOOLHIVE_VERSION="$(node -e '
const fs = require("fs");
const { parse } = require("yaml");
const config = parse(fs.readFileSync(".github/upstream-projects.yaml", "utf8"));
const version = config.projects.find((p) => p.id === "toolhive")?.version;
if (!version) throw new Error("No toolhive version in upstream-projects.yaml");
console.log(version);
')"
export TOOLHIVE_VERSION
./scripts/install-thv.sh

# SWC's native loader rejects the writable parents of /github/home.
# Use a private cache under /tmp, whose sticky bit protects its children.
Expand Down
13 changes: 10 additions & 3 deletions scripts/install-thv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ else
API_ENDPOINT="https://api.github.com/repos/stacklok/toolhive/releases/latest"
fi

# Authenticate when a token is available; anonymous API calls share a low
# per-IP rate limit that CI runners regularly exhaust.
CURL_AUTH=()
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
CURL_AUTH=(-H "Authorization: Bearer $GITHUB_TOKEN")
fi

# Fetch release information
RELEASE_JSON=$(curl -sf "$API_ENDPOINT" || {
echo "Failed to fetch release information from GitHub API"
if ! RELEASE_JSON=$(curl -fsS ${CURL_AUTH[@]+"${CURL_AUTH[@]}"} "$API_ENDPOINT"); then
echo "Failed to fetch release information from $API_ENDPOINT" >&2
exit 1
})
fi

# Print the download URL of the named release asset, or nothing if absent.
asset_url() {
Expand Down
Loading