Skip to content
Reference

GitHub Actions

Inputs, outputs, runtime selection, and snapshot comments for kubb-labs/action.

The kubb-labs/action@v0 action generates and publishes a Studio snapshot. See Publish snapshots from CI for a workflow.

Inputs

InputDefaultDescription
tokenOrganization CI API key. Required.
github-token${{ github.token }}Token that opens the init pull request and writes the snapshot comment.
working-directory.Directory holding the Kubb config and the package.
configkubb.config.tsPath to the config file, relative to working-directory.

Outputs

OutputDescription
snapshot-idID Studio stored the snapshot under.
package-nameName of the generated package.
package-versionVersion of the generated package.
tarball-urlURL of the generated tarball.
integritySHA-512 integrity of the tarball.
agent-urlStudio URL of the CI agent that holds the snapshot.
files-added, files-changed, files-removedGenerated files added, changed, and removed since the previous snapshot on the pull request.

What a run does

The action runs kubb studio snapshot from the repository's own node_modules/.bin/kubb when there is one, so the snapshot matches the version your config and plugins are built against. A local install must be Kubb 5.6.2 or later. Otherwise it runs @kubb/cli@^5.6.1 and @kubb/studio@^5.6.1 through npx.

Each pull request reuses one CI agent and one comment. Each branch reuses one CI agent and gets no comment. The action also:

  • Skips pull requests from forks, because GitHub hides secrets from them.
  • Deletes the pull request's CI agent when the pull request closes.
  • Opens a kubb/init-* pull request and stops when the config file is missing.

What the comment shows

Below the install command, the comment lists which generated files changed:

SectionCompared with
Changes against mainThe latest snapshot of the base branch, from the push trigger
Changes since abc1234The previous snapshot on the same pull request

A failed snapshot shows its error in the comment.

Environment variables

VariableDefaultDescription
KUBB_STUDIO_URLhttps://kubb.studioStudio URL for a self-hosted deployment.