Repository navigation
Use toolhive-actions to build and publish skills - #7273
Conversation
The skills workflows hand-rolled a thv serve lifecycle and a build/push loop that StacklokLabs/toolhive-actions now provides as the skills-publish action. Calling it makes toolhive the first real consumer of those actions and adds a validation gate that fails on skill errors before anything is built. Published references, keyless signing and the signer identity are unchanged: the workflow files keep their names and paths, the registry prefix still resolves to ghcr.io/stacklok/toolhive/skills, and latest is still added only on release tags, now pushed after the versioned tag. The publish workflow stamps the release tag into thv with ldflags, because the action refuses to push with a thv older than v0.48.0 and a plain build reports a development version. Renovate opens a separate PR for each toolhive-actions bump, since that action runs with the release job's OIDC signing token. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7273 +/- ##
==========================================
- Coverage 81.88% 81.85% -0.04%
==========================================
Files 915 915
Lines 92769 92853 +84
==========================================
+ Hits 75966 76005 +39
- Misses 16798 16843 +45
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
peppescg
left a comment
There was a problem hiding this comment.
Thanks Samuele, this is a clean switch and the fork test with an identical digest is very convincing.
What I checked:
- The action at
2a20e95(v0.0.9) is plain bash and calls no other actions, so the SHA pin covers everything that runs with the release job's OIDC token. The points I raised on toolhive-actions #26 are all addressed there: an ownedthv servewhen pushing, escaped annotations, one tag at a time withlatestlast, and separate skills/plugins keys inreferences-json. releaser.ymlruns onrelease: published, and a called workflow sees the caller's event, soreleasepasses the action's trusted-event check even though the fork test used a tag push.- The
Versionldflag matches the Taskfile and goreleaser, andTAGis already checked againstVERSIONbyverify-release. The stamped version doesn't trigger update checks in CI (ShouldSkipUpdateCheckshonoursGITHUB_ACTIONS/CI). - The Build Skills log on this PR shows the validation gate running (0 errors, 0 warnings) and an owned daemon on a free port.
A few non-blocking notes, two of them inline:
- PR body nit: "Each skill is now built once per tag rather than rebuilt for
latest" describes the old loop too, which also built once per tag. What changed is the push order. - Nit: the "Compute registry prefix" step is duplicated in both workflows. That's fine at two lines, just mentioning it.
🤖 Generated with Claude Code
Hold toolhive-actions bumps for three days before Renovate proposes them, since the action runs with the release job's signing identity, and document that a skills/ directory without SKILL.md is now skipped with a warning instead of failing the build. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Samuele Verzi <[email protected]>
peppescg
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up. minimumReleaseAge is in, the skip-without-SKILL.md behaviour is documented in the arch doc and the PR body, and the push-order wording is clear now. Re-approving on e56f71c.
🤖 Generated with Claude Code
Summary
skills-build.ymlandskills-publish.ymleach manage their ownthv servelifecycle and run a hand-written build/push loop. That is the job StacklokLabs/toolhive-actionsskills-publish(v0.0.9) was written for. Switching to it makes toolhive the first real consumer of those actions. It also adds a gate the loop never had: a skill with validation errors now fails CI before anything is built.What gets published doesn't change: the same references, the same keyless signing, and the same signer identity.
thvfrom source, so a PR tests its own validator and builder. The binary goes onPATHand the workflows call the action, pinned by SHA. Thethv servestart/stop steps and the loops are removed.skills-build.ymlcalls the action withpush: 'false'and keeps onlycontents: read.skills-publish.ymlcalls it withpush: 'true'. The tags are the computed tag and, on release tags only,lateston a second line, which the action pushes last. The ghcr login and thepackages: writeandid-token: writepermissions stay.ghcr.io/${github.repository,,}/skillsinstead of being hard-coded. Onstacklok/toolhiveit is stillghcr.io/stacklok/toolhive/skills.renovate.jsontakesStacklokLabs/toolhive-actionsout of the grouped GitHub Actions PR and holds each new release for 3 days before proposing it.docs/arch/12-skills-system.mdnow describes the action in its "In CI" section, and still explains why build and publish are separate workflows.Type of change
skills-publishaction for building and publishing skillsTest plan
task lint-fix): 0 issues.actionlintshows no findings in the changed files other than the existing$/self-repository syntax, which the installed actionlint doesn't recognize yet.renovate-config-validator --strict(latest) passes.Locally, against the action at the pinned commit:
thv skill validate skills/toolhive-cli-userreturns{"valid": true}, with no errors or warnings, so the new gate passes.refs/tags/v0.69.0(result:v0.69.0, thenlatest) and forrefs/pull/1/merge(result: the computed tag only).v0.69.0passes. A plaingo buildreportsbuild-<sha>and is refused, which is why the publish workflow needs the ldflags.End-to-end publish on a personal fork (the publish path can't run from a PR):
v9.9.9-testand called./.github/workflows/skills-publish.ymlwithpackages: writeandid-token: write. I used a tag push rather thanworkflow_dispatchbecause dispatch needs the workflow on the fork's default branch.pushis one of the action's trusted events, andGITHUB_REFwasrefs/tags/v9.9.9-test, as on a release.ghcr.io/samuv/toolhive/skills/toolhive-cli-user:v9.9.9-testand:latest, then pushed:v9.9.9-testfollowed by:latest.thv skill install … --scope projectfor both tags installed the skill as signed. The lock entries showsignerIdentity: /.github/workflows/skills-publish.yml,certIssuer: https://token.actions.githubusercontent.com,repositoryRef: refs/tags/v9.9.9-testandrunnerEnvironment: github-hosted.ghcr.io/stacklok/toolhive/skills/toolhive-cli-user:latest, the provenance fields have the same shape and the samesignerIdentity. The digest is identical (sha256:02b0266b…), so the action's build is byte-for-byte the same as the old loop's.Does this introduce a user-facing change?
No. The published references (
ghcr.io/stacklok/toolhive/skills/<name>:<tag>, plus:lateston releases) and the keyless signer identity are unchanged. The workflow files keep their names and paths, sojob_workflow_refand the signer pinned in consumers'toolhive.lock.yamlstay the same.Contributors will notice two differences in CI:
Build Skills.skills/without aSKILL.mdfailedthv skill buildand turned the job red. Now the action skips it with a::warning::annotation and the job stays green, so that skill is not published.Special notes for reviewers
publish.shrefuses to push unlessthv version --format jsonreports v0.48.0 or later. A plaingo buildreports a development version, soskills-publish.ymlsets-X github.com/stacklok/toolhive/pkg/versions.Version=${TAG}, the variable the Taskfile and goreleaser set. Release tags arevX.Y.Z, so they pass. The version doesn't go into the artifacts; the fork test produced the same digest as the current upstream release.skills-build.ymldoesn't set it because it never pushes.skill-validateand fails on errors. Warnings only show as annotations; the action'sfail-on-warningsis hard-coded off. I didn't add a separate strictskill-validatestep, because it would run the same checks twice. A warnings gate fits better in theskill-refs/skill-budgetfollow-up.2a20e956503d8878c219b2d2b7d91bdf89d731b4(v0.0.9). It runs in the releaser job withid-token: writeand starts thethv servethat receives the OIDC token. So each bump gets its own PR instead of joining the weekend "github actions" group, and Renovate waits 3 days after a release (minimumReleaseAge) before proposing it.github.repositorygives exactly the old value upstream. On a fork it points the publish at the fork's own ghcr, which is how the fork test ran the committed workflow unchanged.:<tag>and then:latestone skill at a time. The action pushes the versioned tag for every skill first, thenlatestfor every skill, solatestmoves only after the release tag has been published for all of them.releaser.ymlhas noconcurrencygroup, so two overlapping releases could movelatestback to the older release. I left it out on purpose: GitHub keeps only one pending run per group, so a third queued release would silently cancel the second's publish. Releases rarely overlap during the few minutes this job runs.:latestcurrently installs withrepositoryRef: refs/tags/v0.59.0, even though skills publishing succeeded on every release since. The skill's digest hasn't changed since then, and thv records the provenance of the first signature found on that digest.skill-refs/skill-budget(follow-up PR), plugins (toolhive has noplugins/), andskills-keyless-signing-e2e.yml, which is unchanged.🤖 Generated with Claude Code