English
Validate in CI
You add one workflow file to your content repository: every push and every pull request runs alta lint, the build fails on the first problem, and the full report is kept as JSON for your tools. It is the same check as on your machine, so what passes there passes here.
Before you begin 10 minutes
- A repository with content that passes
alta lint, for example the pack of the quickstart. - GitHub Actions on that repository. Any other CI works the same way: it runs the same commands.
Check the repository as the CI will
Run the check from the root of your repository.
.checks every content file below it: each.jsonwith a"schema", and each universe folder.--strictmakes a warning fail too, so nothing slips into the main branch half done.Terminalshalta lint . --strictOutputtextok my-pack/quests.json (quests) 1 checked, 0 errors, 0 warningsRead the JSON report
--jsonprints the report in thealta.check/1format:ok, then each file with itsproblemsandwarnings. A problem gives thefield, therule(its section on the errors page), themessage, and where it is incontext. The exit code says the verdict:0ok,1problems found,2bad usage.Terminalshalta lint . --jsonOutput (shape)text{ "schema": "alta.check/1", "ok": false, "files": [ { "path": "my-pack/quests.json", "kind": "quests", "ok": false, "problems": [ { "level": "error", "field": "quests[0].steps[0].kind", "rule": "step.kind", "message": "…", "docs": "https://docs.os.altasystem.ai/reference/errors#step-kind", "context": { "where": "quest core.my-pack.welcome, step read" } } ], "warnings": [] } ], "skipped": [] }Add the workflow
Save this file as
.github/workflows/alta-check.yml. It installs thealtacommand as on your machine, runs the strict check (the step that fails the build), then keeps the JSON report as a build artifact, even when the check failed..github/workflows/alta-check.ymlyaml# A GitHub Actions workflow for a content repository: every push and pull request runs `alta lint`. # Save it as .github/workflows/alta-check.yml in your repository. name: alta lint on: [push, pull_request] jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: 22 - name: Install the alta command working-directory: ${{ runner.temp }} run: | git clone --depth 1 https://github.com/alta-system-os/alta-os.git cd alta-os npm install npm install --global ./tools/cli - name: Check the content run: alta lint . --strict - name: Keep the report as JSON if: always() run: alta lint . --json > "${{ runner.temp }}/alta-check.json" || true - uses: actions/upload-artifact@v4 if: always() with: name: alta-check path: ${{ runner.temp }}/alta-check.jsonPush, and read the result
Push the workflow. On every push and pull request, the job runs; a red job prints each problem with its file, its field, how to fix it and the link to its rule. The
alta-checkartifact holds the JSON report.Terminalshgit add .github/workflows/alta-check.yml git commit -m "Check the content on every push" git push
Pitfalls
| Do | Avoid |
|---|---|
| Write the JSON report outside the folder you check | alta lint . --json > report.json: the next check reads report.json as content |
--strict in CI, so a warning blocks the merge | Letting warnings pile up until they matter |
One alta lint . at the root | A list of files to keep up to date by hand |
| The same Node version as on your machine (20 or later) | An older Node: the command needs 20 |
Known limits, said plainly: alta is not on npm yet, so the workflow installs it from the repository, as on your machine. Files without a "schema" are skipped and listed under skipped: that is how a package.json stays out of the check.
Go further
- alta lint: every option and the exit codes.
- Errors: each rule the report can name.
- Standards and versions: what changes when a standard moves.