Conversation
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Updates the ToolHive reference update workflow to fetch specific, named GitHub release assets (instead of downloading/extracting full source tarballs) to refresh docs and schema artifacts in this documentation repo.
Changes:
- Switch
scripts/update-toolhive-reference.shto usegh release downloadfor required assets (CLI docs tarball, swagger, CRD doc, registry schemas). - Keep toolhive-core version coupling by deriving it from
go.modat the specified ToolHive tag viagh api. - Remove
/importsfrom.gitignoresince temporary extraction directories are no longer used.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/update-toolhive-reference.sh | Reworks the update script to download named release assets via gh and update docs/schemas directly. |
| .gitignore | Removes the now-unused /imports ignore entry. |
| CORE_VERSION=$(gh api "repos/stacklok/toolhive/contents/go.mod?ref=${VERSION}" \ | ||
| --jq '.content' | base64 -d | grep 'github.com/stacklok/toolhive-core' | awk '{print $2}' | head -1) | ||
|
|
||
| if [ -f "${REGISTRY_SCHEMA_SRC}" ]; then | ||
| cp ${REGISTRY_SCHEMA_SRC} ${REGISTRY_SCHEMA_DST} | ||
| echo "Registry JSON schema updated successfully" | ||
| else | ||
| echo "Warning: Registry schema not found at ${REGISTRY_SCHEMA_SRC}" | ||
| if [ -z "$CORE_VERSION" ]; then | ||
| echo "Warning: Could not determine toolhive-core version from go.mod; falling back to latest release" | ||
| CORE_VERSION=$(gh release view --repo stacklok/toolhive-core --json tagName --jq '.tagName') |
There was a problem hiding this comment.
With set -euo pipefail, this command substitution will cause the script to exit early if grep finds no match (exit 1) or if any earlier pipe stage fails, so the intended if [ -z "$CORE_VERSION" ] fallback may never run. Adjust this pipeline to tolerate no-match/fetch failures (e.g., make the assignment non-fatal and allow CORE_VERSION to be empty) so the warning + latest-release fallback can execute as written.
Description
The following PR updates the update-toolhive-reference.sh script to download named release assets directly instead of downloading and extracting full source tarballs.
Before: Downloaded the full toolhive source tarball (~entire repo) and extracted 3 files from it. Did the same for toolhive-core to get the registry schemas.
After: Downloads only the specific files needed:
The toolhive-core version is still derived from go.mod at the tagged commit (via gh api), preserving the version coupling between the two repos.
Also removes /imports from .gitignore as the temporary extraction directory is no longer used.
Dependencies: Requires stacklok/toolhive release v0.X.Y or later which publishes the named assets (thv-cli-docs.tar.gz, swagger.yaml, crd-api.md).
Type of change
Related issues/PRs
Screenshots
Submitter checklist
Content and formatting
Navigation
sidebars.ts) updated for added, deleted, reordered, or renamed filesvercel.jsonfor moved, renamed, or deleted pages (i.e., if the URL slug changed)Reviewer checklist
Content