# Xova Actions
> Guides and configuration examples for checking code, publishing releases and deploying with Xova Actions. [Chinese documentation](https://actions.xovajs.com/zh-cn) is also available.
## Resources for Agents
- [API catalog: every service document this site publishes](https://actions.xovajs.com/.well-known/api-catalog)
- [Sitemap (XML)](https://actions.xovajs.com/sitemap.xml)
- [Sitemap (Markdown): every page on the site](https://actions.xovajs.com/sitemap.md)
- [MCP server card: MCP endpoint at https://actions.xovajs.com/mcp](https://actions.xovajs.com/.well-known/mcp/server-card.json)
- [MCP endpoint (streamable HTTP)](https://actions.xovajs.com/mcp)
- [llms.txt: index of the documentation for LLMs](https://actions.xovajs.com/llms.txt)
- [llms-full.txt: the full documentation as a single file](https://actions.xovajs.com/llms-full.txt)
- [Agent skills index: every skill published by this site](https://actions.xovajs.com/.well-known/skills/index.json)
- [Agent skill: xova-release](https://actions.xovajs.com/.well-known/skills/xova-release/SKILL.md)
- [OpenAPI document: every route this site serves to agents](https://actions.xovajs.com/openapi.json)
Every page on this site is available as raw markdown: append `.md` to its
URL or send `Accept: text/markdown`.
# From CI downloads to tagged releases
> Two workflows share a project configuration for a source ZIP and checksum. Commit the example’s CHANGELOG.md, keep the .github/ directory structure and replace XOVA_ACTIONS_SHA with the full SHA of a commit that passed CI in xova-dev/actions.
Two workflows share a project configuration for a source ZIP and checksum. Commit the example’s `CHANGELOG.md`, keep the `.github/` directory structure and replace `XOVA_ACTIONS_SHA` with the full SHA of a commit that passed CI in `xova-dev/actions`.
[Complete project](https://github.com/xova-dev/actions/tree/main/examples/downloads)
## Project configuration
The example uses Git, unzip and sha256sum. Set your own checks, build command and asset list for APKs or other files.
```json [.github/xova.json]
{
"schemaVersion": 1,
"setup": { "install-command": ":" },
"code": { "check-command": "git show --check --oneline HEAD" },
"artifact": {
"kind": "release-assets",
"check-command": "git ls-files --error-unmatch CHANGELOG.md",
"build-command": "mkdir -p dist && git archive --format=zip -o dist/source.zip HEAD && cd dist && unzip -tq source.zip && sha256sum source.zip > source.zip.sha256",
"output-directory": "dist"
},
"github-release": { "assets": ["source.zip", "source.zip.sha256"] }
}
```
## Daily CI
Pull requests, pushes to main and nightly runs use the same checks. The build waits for them to pass. Download the Actions artifact and open `payload/` to test it. For checks alone, omit the build job.
```yaml [.github/workflows/ci.yml]
name: CI
on:
pull_request:
push:
branches: [main]
schedule:
- cron: '15 2 * * *'
permissions:
contents: read
jobs:
check:
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
build:
needs: check
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
with:
task: artifact
source-sha: ${{ needs.check.outputs.source-sha }}
```
## Tag publication
Reuse full CI at the tag SHA or run the full check on a miss. Rebuild with the same configuration and publish the files by their same-run artifact ID. For notes alone, set `"github-release": {}`, make publish depend on verify and pass its SHA. Omit build and the attachment ID.
```yaml [.github/workflows/publish.yml]
name: Publish
on:
push:
tags: ['v*']
permissions:
contents: read
jobs:
verify:
uses: xova-dev/actions/.github/workflows/check-ci.yml@XOVA_ACTIONS_SHA
permissions:
contents: read
actions: read
with:
run-check-on-miss: true
build:
needs: verify
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
with:
task: artifact
source-sha: ${{ needs.verify.outputs.source-sha }}
publish:
needs: build
uses: xova-dev/actions/.github/workflows/publish.yml@XOVA_ACTIONS_SHA
permissions:
contents: write
id-token: write
with:
expected-sha: ${{ needs.build.outputs.source-sha }}
release-artifact-id: ${{ needs.build.outputs.artifact-id }}
```
For optional delivery, see [npm publication](https://actions.xovajs.com/en/guides/releasing) and [standalone or stable-release deployment](https://actions.xovajs.com/en/guides/deployment).
# Monorepo package and documentation site
> This pnpm workspace contains a private packages/core, a publishable packages/widget and an independent apps/docs. Copy the full directory, including its root lockfile and mise.toml. Replace the package name, repository and tag prefix, and replace XOVA_ACTIONS_SHA with the full SHA of a commit that passed CI in xova-dev/actions.
This pnpm workspace contains a private `packages/core`, a publishable `packages/widget` and an independent `apps/docs`. Copy the full directory, including its root lockfile and `mise.toml`. Replace the package name, repository and tag prefix, and replace `XOVA_ACTIONS_SHA` with the full SHA of a commit that passed CI in `xova-dev/actions`.
[Complete project](https://github.com/xova-dev/actions/tree/main/examples/monorepo)
## Project configuration
Install from the widget directory using the root lockfile and check the whole workspace. The widget bundles core, then installs and imports the packed tarball outside the workspace. The site builds separately in apps/docs.
```json [.github/xova.json]
{
"schemaVersion": 1,
"setup": {
"toolchain": "mise",
"working-directory": "packages/widget",
"install-command": "pnpm install --frozen-lockfile",
"cache": {
"pnpm": "pnpm-lock.yaml"
}
},
"code": {
"check-command": "pnpm -w test"
},
"npm": {
"tag-prefix": "widget@",
"package-manager": "pnpm",
"verify-command": "pnpm build",
"tarball-verify-command": "pnpm test:pack"
},
"artifact": {
"provider": "github-pages",
"working-directory": "apps/docs",
"check-command": "pnpm test",
"build-command": "pnpm build",
"output-directory": "_site",
"deployment-policy": "always",
"environment": "github-pages",
"concurrency-group": "github-pages"
}
}
```
## Daily CI
Pull requests and pushes to main build a downloadable site after checks pass. To deploy main pushes to GitHub Pages, set the repository variable `DOCS_CHANNEL` to `main` and select GitHub Actions in Pages settings.
```yaml [.github/workflows/ci.yml]
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
check:
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
build_site:
needs: check
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
with:
task: artifact
source-sha: ${{ needs.check.outputs.source-sha }}
deploy:
if: github.event_name == 'push' && vars.DOCS_CHANNEL == 'main'
needs: build_site
uses: xova-dev/actions/.github/workflows/deploy.yml@XOVA_ACTIONS_SHA
permissions:
contents: read
pages: write
id-token: write
with:
source-sha: ${{ needs.build_site.outputs.source-sha }}
artifact-id: ${{ needs.build_site.outputs.artifact-id }}
```
## Tag publication
A tag such as `widget@1.2.0` reuses or runs CI at the tag commit, publishes the widget to npm and creates a GitHub Release from the package changelog. By default the site builds alongside publication and deploys after a stable Release. With `deployment-policy: always`, rerunning deployment for an older stable tag can put that version back on Pages. Setting `DOCS_CHANNEL=main` skips the site build and deployment on tags.
```yaml [.github/workflows/publish.yml]
name: Publish widget
on:
push:
tags: ['widget@*']
permissions:
contents: read
jobs:
verify:
uses: xova-dev/actions/.github/workflows/check-ci.yml@XOVA_ACTIONS_SHA
permissions:
contents: read
actions: read
with:
run-check-on-miss: true
publish:
needs: verify
uses: xova-dev/actions/.github/workflows/publish.yml@XOVA_ACTIONS_SHA
permissions:
contents: write
id-token: write
with:
expected-sha: ${{ needs.verify.outputs.source-sha }}
build_site:
if: vars.DOCS_CHANNEL != 'main'
needs: verify
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
with:
task: artifact
source-sha: ${{ needs.verify.outputs.source-sha }}
deploy:
needs: [build_site, publish]
uses: xova-dev/actions/.github/workflows/deploy.yml@XOVA_ACTIONS_SHA
permissions:
contents: read
pages: write
id-token: write
with:
source-sha: ${{ needs.build_site.outputs.source-sha }}
artifact-id: ${{ needs.build_site.outputs.artifact-id }}
release-tag: ${{ github.ref_name }}
```
See the [release guide](https://actions.xovajs.com/en/guides/releasing) to prepare the tag.
# Workflow architecture
> Your project sets triggers, job dependencies and permissions in .github/workflows/. Daily CI and tag publication can use the same check and build commands from .github/xova.json.
Your project sets triggers, job dependencies and permissions in `.github/workflows/`. Daily CI and tag publication can use the same check and build commands from `.github/xova.json`.

## Triggers and checks
Pull requests and branch pushes typically call `check.yml` directly. Its default task, `code`, runs the project's checks. Scheduled and manual runs can use the same entry. A check-only workflow ends here. For a minimal setup, see [Run tests on pull requests](https://actions.xovajs.com/en/guides/adoption).
A tagged commit may already have passed CI. `check-ci.yml` looks for a full check at the same SHA with the same config and returns the verified `source-sha`. Set `run-check-on-miss: true` to run the full check on a miss. Make publication depend on successful verification and pass that SHA as `expected-sha`.
## Build and download artifacts (optional)
When you need files, add a job calling `check.yml` with `task: artifact`. Use `needs` to wait for the code check or tag verification and pass its `source-sha`. The build returns `source-sha` and the `artifact-id` for this run.
| What to build | `artifact.kind` | After the build |
| --- | --- | --- |
| Project files such as ZIPs, APKs and checksums | `release-assets` | Download the artifact from the Actions run and test the files in `payload/`. A tag workflow can also attach selected files to a release. |
| Static site | `static` | Download it for inspection or deploy it to GitHub Pages, Cloudflare Pages or Cloudflare Workers. |
| Prebuilt Worker | `bundle` | Package the Worker entry point, modules, configuration and static assets together for Cloudflare Workers. |
## Delivery and targets (optional)
**To publish a version**, call `publish.yml` from a tag. A notes-only GitHub Release can follow commit verification directly. For attachments, pass the `artifact-id` returned by the build to the `release-artifact-id` input of `publish.yml`. With npm configured, publication packs, verifies and publishes the same tarball, then creates the GitHub Release. [Release guide](https://actions.xovajs.com/en/guides/releasing)
**To deploy a site or Worker**, call `deploy.yml` with the build's `source-sha` and `artifact-id`. An independent deployment from `main` only needs the build to succeed. For a site that follows stable releases, also make deployment wait for the GitHub Release and pass `release-tag`. [Deployment guide](https://actions.xovajs.com/en/guides/deployment)
## Configure your project
Each project below includes a daily CI workflow and a tag workflow. Copy the project configuration and workflows that fit your project, then choose the build and delivery jobs you need.
| Complete example | Daily CI | Tag publication |
| --- | --- | --- |
| [downloads](https://actions.xovajs.com/en/examples/downloads) | Download the source ZIP and checksum from PR, main and nightly runs. | Rebuild at the tag and attach the verified files to the GitHub Release. |
| [monorepo](https://actions.xovajs.com/en/examples/monorepo) | Check the workspace and build the documentation site. Optionally deploy from main. | Install and test the widget tarball outside the workspace, publish to npm and create a GitHub Release. The site follows stable releases by default. |
For a custom runner, test matrix or step order, compose the public actions in your own job. See [Workflow and action interfaces](https://actions.xovajs.com/en/guides/architecture) for inputs, outputs and permissions.
# Adopt the workflows
> Run a pnpm or npm project's tests on pull requests with read-only repository access.
This example uses a Node project on GitHub.com with a `test` script in its root `package.json`.
## Run tests on pull requests
### Set the check command
Create `.github/xova.json`.
- **pnpm**: Commit `pnpm-lock.yaml` and declare your Node and pnpm versions in `mise.toml`.
- **npm**: Commit `package-lock.json`. The workflow uses Node 24 and `npm ci` by default.
```json [pnpm]
{
"schemaVersion": 1,
"setup": {
"toolchain": "mise",
"install-command": "pnpm install --frozen-lockfile"
},
"code": { "check-command": "pnpm test" }
}
```
```json [npm]
{
"schemaVersion": 1,
"code": { "check-command": "npm test" }
}
```
### Add the PR workflow
Create `.github/workflows/ci.yml`.
```yaml [.github/workflows/ci.yml]
name: CI
on: pull_request
permissions:
contents: read
jobs:
check:
uses: xova-dev/actions/.github/workflows/check.yml@XOVA_ACTIONS_SHA
```
### Open a pull request
Replace `XOVA_ACTIONS_SHA` directly in the workflow file with the full 40-character SHA of a commit that passed CI in `xova-dev/actions`.
Commit the files and open a pull request. In the `CI` run, verify that dependencies were installed from the lockfile and the project’s `test` script passed.
If GitHub blocks the run, check that your repository's Actions settings allow the workflow and the actions it calls. For a private workflow, its repository must also grant your repository access.
## Next steps
- [Daily CI and tag publication](https://actions.xovajs.com/en/examples/downloads) use one config. Download a ZIP to test, then build attachments from the version tag.
- [Monorepo package and documentation site](https://actions.xovajs.com/en/examples/monorepo) covers a shared package, an isolated npm tarball install and GitHub Pages deployment.
- [Release a version](https://actions.xovajs.com/en/guides/releasing). Choose npm or a standalone GitHub Release and configure checks for the tagged commit.
- [Deploy documentation](https://actions.xovajs.com/en/guides/deployment). Choose a provider and configure the artifact and deployment permissions.
# Releasing
## Before release
Preview the version and release notes with [release-it](https://actions.xovajs.com/en/guides/release-it) and `--dry-run`. If an upgrade requires code or configuration changes, describe them in the changelog.
### npm Trusted Publishing
Register the GitHub owner, repository, filename of the workflow calling `publish.yml` and matching GitHub environment with npm. In `package.json`, `repository` must match the public repository, including case.
For a subpackage, point `setup.working-directory` at the package directory. You can also record its location in `package.json` with `repository.directory`. `npm.tag-prefix` defaults to `v`. Set it only if your tags use another prefix, such as `widget@`.
A root package uses the default working directory. See the [monorepo example](https://actions.xovajs.com/en/examples/monorepo) for a package subdirectory, an isolated installation test and package-scoped tags.
## Release sequence
1. **Push the tag.** From a clean worktree with push access to the tracked remote, rerun release-it without `--dry-run`. It commits the version and changelog, creates the tag and pushes.
2. **Verify the commit.** Run full project checks on the tagged SHA or reuse a successful full CI run for it. `CHANGELOG.md` must contain exactly one nonempty section for the version.
3. **Publish to npm (if configured).** CI packs with pnpm or npm. If `tarball-verify-command` is set, it tests the archive at `TARBALL`. CI publishes that archive using OIDC.
4. **Create the GitHub Release.** Use the tagged changelog and verify any configured assets before publication. If npm is configured, wait for it to succeed.
Protect release tags and use tag pushes as the only automatic publication trigger. To update a site alongside a stable release, see [deployment policy](https://actions.xovajs.com/en/guides/deployment#deployment-policy).
## GitHub Release assets
1. For notes alone, set `"github-release": {}`. Notes come from the tracked `CHANGELOG.md` in `setup.working-directory`. Tags default to `v` plus SemVer. Standalone releases can set `github-release.tag-prefix`. npm projects inherit `npm.tag-prefix`.
2. Use `check.yml` with `task: artifact`, `artifact.kind: release-assets` and the default component `app`. Custom jobs can sign files and upload their directory with `artifact-pack` and `kind: release-assets`. List the top-level filenames in `github-release.assets`, preserving case.
3. In the same run, pass the returned `artifact-id` to `publish.yml` as `release-artifact-id`. The workflow verifies the source and digest, uploads to a draft, then checks GitHub’s SHA-256 values before making the Release public. Omit `release-artifact-id` when there are no assets.
An explicit list, including `[]`, must match the published assets exactly. If an npm project omits the list, reruns preserve assets the project added. See the [downloads tag workflow](https://actions.xovajs.com/en/examples/downloads#tag-publication).
## Failure recovery
**If the npm outcome is uncertain, verify the registry and provenance first.** A missing receipt or temporary 404 does not justify republishing.
| Symptom | Next action |
| --- | --- |
| Local release-it stopped halfway | Inspect the worktree, local and remote tags, and their SHAs. If the tag was pushed, inspect the original run and keep the tag and version. |
| Source, repository identity or tarball verification failed | Correct and revalidate the candidate. Match `package.json` `repository` to the actual GitHub repository, including case. |
| A check failed transiently | Select **Re-run failed jobs** on the original run. |
| npm succeeded, GitHub Release failed | Rerun only the Release job and resume its matching draft. For manual recovery, verify the package name, version, tag SHA and each asset digest. Keep the original notes and prerelease flag. Stop on a conflicting Release. |
| Receipt missing or upload failed | Check npm logs, registry and provenance. Once publication is confirmed, recover only the missing GitHub Release. See [npm publication results](https://actions.xovajs.com/en/guides/publication-results). |
| GitHub Release succeeded, docs deployment failed | Rerun deployment with the original artifact. If it expired, confirm the stable tag and SHA, rebuild from that SHA with a compatible toolkit version and deploy in the same run. |
# Deploy a site or Worker
> A site built on main can deploy as soon as its build succeeds. To tie deployment to a stable release, make it depend on both jobs (needs: [build_site, publish] in the monorepo example) and pass the tag as release-tag. Monorepo workflows
A site built on `main` can deploy as soon as its build succeeds. To tie deployment to a stable release, make it depend on both jobs (`needs: [build_site, publish]` in the monorepo example) and pass the tag as `release-tag`. [Monorepo workflows](https://actions.xovajs.com/en/examples/monorepo)
## Deployment permissions
Build with `check.yml` and pass its `source-sha` and `artifact-id` to `deploy.yml`. Use the same `config-file` for both. Grant write permissions and deployment credentials only to the deploy job.
| Provider | GitHub permissions | Cloudflare token permissions |
| --- | --- | --- |
| GitHub Pages | `contents: read`, `pages: write`, `id-token: write` | — |
| Cloudflare Pages | `contents: read` | Pages write access on the target account |
| Cloudflare Workers | `contents: read` | `Workers Scripts: Edit` on the target account |
Cloudflare production deployments use `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` from repository secrets or organization secrets shared with the repository. Previews use `CLOUDFLARE_PREVIEW_ACCOUNT_ID` and `CLOUDFLARE_PREVIEW_API_TOKEN` from the `docs-preview` environment. See [manual previews](https://actions.xovajs.com/en/guides/deployment#manual-cloudflare-workers-previews).
For automatic D1 provisioning, set `binding` and `database_name` in `d1_databases`, omit `database_id` and grant `D1: Edit`. Wrangler reuses the named database or creates it if missing.
## Deployment policy
Production evaluates `artifact.deployment-policy` after environment protection rules pass and the job holds the concurrency lock.
| Policy | `release-tag` | Deployment condition |
| --- | --- | --- |
| `latest-stable` (default) | Required | The tag identifies the latest published stable GitHub Release and resolves to `source-sha`. An older stable release is skipped. |
| `always` | Supplied | Any published stable GitHub Release whose tag resolves to `source-sha`. |
| `always` | Omitted | Deploy the artifact for `source-sha` without a Release lookup, e.g. on a push to `main`. |
Tagged deployments first skip drafts and prereleases. `latest-stable` also skips older stable releases. Only then does the job resolve the tag’s commit and compare it with `source-sha`. A mismatch or a failed lookup at any required step fails the job.
## Choose a provider
### GitHub Pages
Select `github-pages`, set `artifact.output-directory` to the built site and choose GitHub Actions as the source in the repository’s Pages settings. See the [monorepo site workflow](https://actions.xovajs.com/en/examples/monorepo).
### Cloudflare Pages Direct Upload
Set `artifact.provider` to `cloudflare-pages` and `project-name` to an existing Pages project. To deploy from `main`, filter for that branch in the caller and set `deployment-policy: always`.
Wrangler uploads the verified `payload/` to production and records the source SHA. A root `_worker.js` file or directory fails validation before upload because Pages treats it as a server entry point.
### Cloudflare Workers static assets
Point `artifact.output-directory` at the built site. Use a standalone Wrangler JSONC file with `assets.directory` pointing to a subdirectory next to that file. Omit `main`, `build.command` and inherited configuration.
The deploy job verifies the same-run artifact’s repository, commit and digest, then restores all files, including dotfiles, under `assets.directory` in a temporary directory. The official Wrangler Action uploads them with the pinned version, without reinstalling or rebuilding.
### Prebuilt Workers
Prebuilt Workers support production only. This `artifact` section uses the [pnpm project setup](https://actions.xovajs.com/en/examples/monorepo#project-configuration). `wrangler-config` is relative to `output-directory`. `server/` and `public/` can be siblings.
```json
{
"component": "api",
"kind": "bundle",
"provider": "cloudflare-workers",
"worker-name": "example-api",
"output-directory": ".output",
"wrangler-config": "server/wrangler.json",
"check-command": "pnpm test",
"build-command": "pnpm build"
}
```
Package `main`, its imported modules and any declared static assets together. If the build emits multiple modules, add module collection rules to the final Wrangler config.
The deploy job verifies the component, artifact kind, config path in the manifest, Worker name and `payload/` digest. It then runs `deploy --no-bundle` with the pinned Wrangler version in a clean directory.
## Manual Cloudflare Workers previews
1. Enable the workers.dev preview URL for a dedicated Worker in a separate Cloudflare preview account.
2. Set `CLOUDFLARE_PREVIEW_ACCOUNT_ID` and `CLOUDFLARE_PREVIEW_API_TOKEN` in the `docs-preview` GitHub environment. Limit Worker write access to the preview account. Set the repository variable `XOVA_DOCS_PREVIEW_WORKER` to the Worker name.
3. Enter the full commit SHA in the `workflow_dispatch` input. With `require-reachable: true`, a repository branch or tag must contain the commit. Pass the build’s `source-sha` and `artifact-id` to `deploy.yml` with `target: preview` and omit `release-tag`.
Check the preview URL and full SHA in the run summary. Previews serve static artifacts only, preserve `assets.base_path` and exclude production routes and bindings. Deployments from one repository to the same preview Worker run in sequence.
Skip the manual build when the preview variable is unset. A direct call with `target: preview` fails validation if the variable is missing or blank. For multiple sites, assign distinct `artifact.component` and `artifact-name` values.
# release-it configuration
## Install release-it in your project
Pin `release-it` and the Conventional Changelog plugin. Use Node `^22.22.2`, `^24.15.0` or `>=26.0.0`.
```sh [pnpm]
pnpm add --save-dev --save-exact release-it@21.1.3 @release-it/conventional-changelog@12.0.2
```
```sh [npm]
npm install --save-dev --save-exact release-it@21.1.3 @release-it/conventional-changelog@12.0.2
```
## Pin the preset
In the root `.release-it.json`, replace `XOVA_ACTIONS_SHA` with the full SHA of a commit that passed CI in `xova-dev/actions`.
```json
{
"extends": ["github:xova-dev/actions/config#XOVA_ACTIONS_SHA"]
}
```
For local testing, use the absolute path to this checkout’s `config/`. For a subpackage, run the CLI in the package directory and set `git.tagName` if needed, e.g. `widget@${version}`.
## Release a version
Replace `0.4.0` with the target version and preview the notes with `--dry-run`.
```sh [pnpm]
pnpm exec release-it 0.4.0 --ci --dry-run
```
```sh [npm]
npm exec -- release-it 0.4.0 --ci --dry-run
```
Before pushing, check the following.
1. The preview shows the intended version and release notes, including any migration instructions.
2. The branch is clean, tracks the intended remote and can push commits and tags.
3. The consumer publishes on tag push. When upgrading the old preset, remove local GitHub Release overrides and credential hooks.
Rerun without `--dry-run`. release-it runs project hooks, commits the version and changelog, creates the tag and pushes. The Git push needs no GitHub API token.
## Configure npm publication in CI
| Setting | Publication behavior |
| --- | --- |
| `npm.verify-command` | Check and build the clean candidate. Run required builds explicitly because packing disables lifecycle scripts. |
| `npm.package-manager` | Defaults to `npm`. Choose `pnpm` to expand `catalog:` or `workspace:` dependencies. |
| `npm.tarball-verify-command` | Optional. Test the archive at the absolute path in `TARBALL`. Omit for identity and consistency checks only. |
| `npm.dist-tag` | Stable versions default to `latest`, prereleases to `next`. Prereleases cannot use `latest`. A dist-tag must not parse as a SemVer range. |
CI uses locked release-it 21.1.3, OIDC-capable npm 11.5.1+ and the [isolated publication preset](https://github.com/xova-dev/actions/blob/main/config/npm-publish.mjs). The built-in npm publisher receives the same file after verification of the archived manifest, final source and SHA-256.
An active `dry-run` in the environment or `.npmrc` blocks publication. After handoff to npm, wait for confirmation. See the [publication receipt](https://actions.xovajs.com/en/guides/publication-results).
# npm publication results
> Check the package name, version and tarball digest in the publish job summary or the same run’s publication-result.json. The receipt still records npm success if the GitHub Release or docs deployment later fails.
Check the package name, version and tarball digest in the publish job summary or the same run’s `publication-result.json`. The receipt still records npm success if the GitHub Release or docs deployment later fails.
## Receipt fields
| What to verify | JSON fields |
| --- | --- |
| Record format | `schemaVersion` is `1`, `status` is `published` |
| Package identity | `repository`, `packageName`, `version` (registry version), `sourceVersion` (including build metadata), `npmTag` (resolved dist-tag) |
| Source and contents | `releaseTag`, `sourceSha`, `tarballSha256` (digest of the original file verified before publication) |
| GitHub run | `runId`, `runAttempt`, `runUrl`. |
`publish-npm` and `publish.yml` return `source-sha`, `version`, `tarball-sha256` and `receipt-artifact-name`. Download the JSON-only artifact by its `receipt-artifact-name`. Repository retention defaults apply.
## If the receipt is missing
| Condition | Outcome or action |
| --- | --- |
| Candidate checks failed, publication was skipped, or npm failed | No success receipt is generated. |
| Writing the job summary failed | A warning is logged. JSON upload continues and publication outputs remain available. |
| npm succeeded but writing JSON, writing `GITHUB_OUTPUT` or uploading the receipt failed | The job can fail after publication. Verify npm logs, registry and provenance. Do not republish. |
For an expired receipt, verify the package name, version and source SHA the same way. See [failure recovery](https://actions.xovajs.com/en/guides/releasing#failure-recovery) if the GitHub Release or docs deployment stopped.
# Workflow and action interfaces
> Shared workflows use GitHub.com hosted Ubuntu runners with Node 24 by default. Projects can use mise and choose their triggers, permissions and checks. For another runner or step order, call the public composite actions from a project job and test on that runner.
Shared workflows use GitHub.com hosted Ubuntu runners with Node 24 by default. Projects can use mise and choose their triggers, permissions and checks. For another runner or step order, call the public composite actions from a project job and test on that runner.
## Task requirements
| Task | Configuration |
| --- | --- |
| `code` | `code.check-command` |
| `artifact` | `artifact.check-command`, `artifact.build-command` and `artifact.output-directory`, even with `provider: none`. |
| Publish | `github-release` or `npm`. The `npm` section requires `npm.verify-command`. |
| Deploy | Select the platform with `artifact.provider`. Cloudflare Pages requires `project-name`. Workers read `static` config from source. A `bundle` supplies its own config and requires `worker-name`. |
The [input JSON Schema](https://github.com/xova-dev/actions/blob/main/config/project.schema.json) defines fields and types. Each task validates its configuration before running commands.
## Pass inputs between workflows
Projects call these four workflows with `jobs..uses`.
| Workflow | Inputs |
| --- | --- |
| All | `config-file` defaults to `.github/xova.json`. Deploy with the same tracked config used to build that artifact. |
| `check.yml` | `task` defaults to `code`, `source-sha` to the event SHA. With `require-reachable` enabled, a repository branch or tag must contain the commit. |
| `check-ci.yml` | `workflow-file` selects the CI workflow to look up. It defaults to `.github/workflows/ci.yml` in the caller’s repository. |
| `publish.yml` | On tag events, `release-tag` defaults to `github.ref_name` and `expected-sha` to `github.sha`. If an upstream job verified the commit, pass its SHA as `expected-sha`. |
| `deploy.yml` | Pass the build’s `source-sha` and exactly one of `artifact-id` or `artifact-name`. `production` with `latest-stable` requires `release-tag`. Omit it for `preview`. |
Grant the job calling `publish.yml` both `contents: write` and `id-token: write`, even for a standalone GitHub Release. Only the npm publish job uses OIDC. Grant provider write access and secrets only to the deployment job.
## Checks and caching
- For docs-only checks in routine CI, enable `detect-changes` and set `code.docs-only-paths` and `code.docs-only-command`. PRs compare against the merge base, pushes against the event’s before SHA.
- All changes must match the listed paths to run the docs-only command. A config change, empty diff or missing base triggers the full code check. The docs job still builds the artifact.
- Use `detect-changes: false` for releases. A build-only `npm.verify-command` requires full project checks to have passed on the same SHA. Otherwise, include all required checks.
### Reuse CI for a release commit
`check-ci.yml` needs `contents: read` and `actions: read`. It looks up the latest trusted `push` or `workflow_dispatch` run for the SHA. Reuse requires the whole run to have succeeded, including a full code check with the same config file.
- **Single check command** — Set `run-check-on-miss: true` to run the full check on a miss or timeout. See the [monorepo tag publication](https://actions.xovajs.com/en/examples/monorepo#tag-publication).
- **Project matrix** — Lookup is the default. If it succeeds with an empty `source-sha`, run the matrix on the candidate commit and pass the verified SHA to publication.
Invalid inputs fail the job. Require successful verification before publication and build any deployment artifact in the same run.
### Dependency caches
| Setting | Behavior |
| --- | --- |
| Omit `setup.cache` | Checks detect pnpm or npm lockfiles in the install directory and skip caching if both types are present or both are missing. pnpm must be on `PATH`. npm prefers `npm-shrinkwrap.json`. |
| Set `setup.cache` | Lockfile paths or globs for `pnpm`, `npm` and `uv` are relative to the repository root. Each enabled entry must match at least one file or the job fails before installing dependencies. |
| `artifact.cache` | Replaces the inherited cache settings. `{}` disables caching for the artifact build. |
npm publication uses only explicit `setup.cache` entries. On a cache hit, jobs still install locked dependencies and run checks.
## Public actions
Each linked `action.yml` lists the inputs and outputs.
### Checks
| Action | When to use it |
| --- | --- |
| [project-config](https://github.com/xova-dev/actions/blob/main/actions/project-config/action.yml) | Reads the tracked project config at the selected commit, checks the working tree and config, and fills in defaults. CI can also use it to detect docs-only changes. |
| [setup](https://github.com/xova-dev/actions/blob/main/actions/setup/action.yml) | Sets up the selected toolchain for checks, builds or publication. Use the `cache` JSON input to configure pnpm, npm or uv download caches. Installation still uses the lockfile on a cache hit. |
| [check-ci-run](https://github.com/xova-dev/actions/blob/main/actions/check-ci-run/action.yml) | Looks up full CI for `expected-sha`. Defaults are `.github/workflows/ci.yml` for `workflow-file`, `.github/xova.json` for `config-file`, and 1800 for `wait-seconds`. A match returns `source-sha` and `run-id`. On an empty result, the caller runs its full checks. If `input-error` is `true`, stop the release. |
| [check-source](https://github.com/xova-dev/actions/blob/main/actions/check-source/action.yml) | Checks that HEAD matches `expected-sha` and that tracked files and the index are clean. Returns `source-sha` on success. |
### Artifacts
| Action | When to use it |
| --- | --- |
| [artifact-pack](https://github.com/xova-dev/actions/blob/main/actions/artifact-pack/action.yml) | Pass `expected-sha` and `output-directory`. Run project checks and build first, or use `check.yml` to orchestrate both commands and packing. Returns `source-sha` and `artifact-id`. |
| [artifact-restore](https://github.com/xova-dev/actions/blob/main/actions/artifact-restore/action.yml) | Release asset publication and deployment adapters use this action. It downloads by ID or name, verifies the manifest and content digest, and returns `payload-directory` and `source-sha`. |
### Publication
| Action | When to use it |
| --- | --- |
| [check-release-notes](https://github.com/xova-dev/actions/blob/main/actions/check-release-notes/action.yml) | Checks the triggering tag, its commit SHA and the notes for that version in the changelog. |
| [publish-npm](https://github.com/xova-dev/actions/blob/main/actions/publish-npm/action.yml) | Publishes a public package using `release-tag` and `verify-command`. You can also set `expected-sha` and `tarball-verify-command`. Defaults are `v` for the tag prefix, `.` for the working directory, `auto` for the dist-tag and `npm` for the packer. On success it returns `source-sha`, `version`, `tarball-sha256` and `receipt-artifact-name`. |
| [publish-github-release](https://github.com/xova-dev/actions/blob/main/actions/publish-github-release/action.yml) | Publish or resume a GitHub Release from the verified source and assets. |
### Deployment
| Action | When to use it |
| --- | --- |
| [check-release-eligibility](https://github.com/xova-dev/actions/blob/main/actions/check-release-eligibility/action.yml) | Requires release-tag and expected-sha. `latest-only=false` accepts an already published stable Release; the default additionally requires it to be latest. API errors/source mismatches fail. |
| [deploy-github-pages](https://github.com/xova-dev/actions/blob/main/actions/deploy-github-pages/action.yml) | Requires expected-sha and either `artifact-id` or a site-specific `artifact-name`. Validates then deploys, returning `url`. Does not need checkout or npm dependencies. |
| [deploy-cloudflare-pages](https://github.com/xova-dev/actions/blob/main/actions/deploy-cloudflare-pages/action.yml) | Validates the selected artifact and uploads its static `payload/` to the production environment of `project-name`. Wrangler runs outside the checkout and records the verified source SHA on the deployment. |
| [deploy-cloudflare-worker](https://github.com/xova-dev/actions/blob/main/actions/deploy-cloudflare-worker/action.yml) | `static` reads serving configuration from the selected commit. `bundle` checks `worker-name` and deploys with the packaged config without checking out source. Static previews require `preview-worker` and return the immutable `url` including the site base path. |
## Candidate verification rules
- **Commit** — The native `GITHUB_SHA` and tag must match the candidate. Check HEAD, tracked files and index before and after product commands. Untracked build output is allowed.
- **Repository** — `package.json` `repository` must identify the public consumer repository, matching `GITHUB_REPOSITORY` including case. A string or `url` object is accepted. Passwords, usernames other than `git`, query strings and fragments are rejected. A local Git remote cannot supply missing package metadata.
- **Version** — Use canonical SemVer without a `v` prefix or invalid leading zeroes. Source and tag retain build metadata. The registry omits it, so `0.2.0+build.007` publishes as `0.2.0`.
- **Archive** — Verify name, version, non-private status and repository from the packed `package/package.json`, including an alternate manifest produced by `publishConfig.directory`. Recheck the original tarball SHA-256 before publication.
See [release-it configuration](https://actions.xovajs.com/en/guides/release-it) for packers and `TARBALL` tests. See [Deploy documentation](https://actions.xovajs.com/en/guides/deployment) for permissions and deployment policy.
## Artifact manifest
Each artifact built with `artifact-pack` contains `payload/` and `source.json`. The manifest requires the following fields.
```json
{ "schemaVersion": 3, "repository": "owner/repo", "sha": "<40 lowercase hex>", "component": "app", "kind": "static", "digest": "" }
```
`artifact-pack` and all three deployment adapters accept `component`, defaulting to `app`. Multi-site callers assign each site a distinct ID and pass it to both build and deployment.
Deployment verifies the repository, source SHA, component, artifact kind and content digest. Build output must be a project subdirectory containing regular files. Hidden content such as `.well-known/` is included. GitHub Pages excludes `.git/` and `.github/`.
Artifacts are retained for seven days by default. Restore them from the same trusted run and grant production credentials only to the deployment job.
## Compatibility
The public interface covers workflow and action inputs, outputs, defaults, failure and skip conditions, and artifact formats. Pin workflows, actions and the release-it preset to the same full commit SHA from `xova-dev/actions`. To upgrade, select a new commit that passed toolkit CI, update the references together and run the workflows your project uses.
# Maintain Xova Actions
## Check a change locally
| Command | What it checks |
| --- | --- |
| `mise exec -- pnpm check` | Regenerates distribution files, runs tests and runs `pnpm lint`. |
| `mise exec -- pnpm lint` | Runs `lint:actions` for workflows and action metadata, then `lint:repo` for JS/TS, Markdown, YAML, JSON/JSONC, TOML and pnpm configuration, including tests and examples. |
| `mise exec -- pnpm build:check` | Checks the committed distribution files and licenses against the build output without writing files. |
| `mise exec -- pnpm docs:build` | Builds the Node version of both documentation locales for local preview. |
| `mise exec -- pnpm docs:preview` | Serves the built site locally, including the read-only `/mcp` endpoint. |
| `mise exec -- pnpm docs:build:worker` | Builds the production Worker and static assets in `docs/.output/`. The public site URL is `https://actions.xovajs.com`. |
Edit guides in both `docs/content/zh-cn/` and `docs/content/en/`. Example commands and configs live in `examples/`, titles and descriptions in `docs/prepare-examples.mjs`.
Run `docs:build`, then `docs:preview`. Check both locales and their raw Markdown, e.g. `/raw/en/guides/deployment.md`.
## Read the GitHub Actions results
| Job | What it verifies |
| --- | --- |
| `check` | Checks the distribution files, installs the tools pinned by the examples, then runs tests and lint. |
| `code` | Runs the monorepo workspace tests through the shared `check.yml`. |
| `docs` | Builds `examples/monorepo/apps/docs` at the same SHA and uploads an artifact with hidden files. |
| `verify` | Downloads the `docs` artifact by ID. Checks that `code` and `docs` returned the current commit SHA, then verifies the full-check marker, homepage HTML and contents of `.well-known/security.txt`. |
All four jobs use `contents: read`. See [internal-ci.yml](https://github.com/xova-dev/actions/blob/main/.github/workflows/internal-ci.yml).
## First deployment of the Actions documentation site
On pull requests, [internal-docs.yml](https://github.com/xova-dev/actions/blob/main/.github/workflows/internal-docs.yml) only builds the Worker. Before the first deployment, confirm that `xovajs.com` is active in the target Cloudflare account and that `actions.xovajs.com` is available for this site.
1. Create a Cloudflare API token, optionally using the `Edit Cloudflare Workers` template. Scope it to the target account, limit its zone permissions to `xovajs.com` and grant the account permissions below.| Account permission | Purpose |
| --- | --- |
| `Workers Scripts: Edit` | Upload the Worker and static assets and attach the custom domain. |
| `D1: Edit` | Look up an existing database and create one on first deployment if needed. |
2. In the `xova-dev` GitHub organization, open **Settings → Secrets and variables → Actions** and add two organization secrets. For both, set repository access to **Selected repositories → `xova-dev/actions`**.| Organization secret | Value |
| --- | --- |
| `CLOUDFLARE_ACCOUNT_ID` | Cloudflare Account ID for the account hosting `xovajs.com`. |
| `CLOUDFLARE_API_TOKEN` | The token created in the previous step. |
On pushes to `main`, the deploy job uploads the Worker built in that run. Wrangler reuses the D1 database `xova-actions-docs` by name or creates it if missing. The Worker uses the `DB` binding. You can omit `database_id`. See the [Wrangler config](https://github.com/xova-dev/actions/blob/main/docs/wrangler.jsonc).
## What the local tests cover
- **CI reuse.** Tests vary the repository, source SHA, config and run attempt. They also check fallback after matrix failures, timeouts and runs missing the full-check marker.
- **Dependency caches.** Tests install real dependencies on cache hits and misses using a stand-in for the hosted cache API. Check a hosted run for transfer results and timing.
- **Publishing.** Tests run release-it and pack real tarballs with pnpm or npm. They substitute test responses for the remote APIs. On the first release, check OIDC, the published registry version and provenance.
- **Deployment.** Tests check the source SHA, artifact files and digest. To inspect the Worker upload arguments locally, set `XOVA_TEST_WRANGLER` to the absolute path of `bin/wrangler.js` for the repository’s pinned Wrangler version. Run `mise exec -- node --test test/deployment-artifact.test.mjs`. The test uses `--dry-run`.