What This Project Does
It checks that a workflow run behaved the way you said it should.
You define the expected shape of a run in CUE, collect the actual run
payload as JSON, then compare both. That is the full model.
github-actionspec-rs links three things: the workflow behavior you
expect, the workflow payload you observed, and the validation report that explains
whether they match.
.cue contractbuild-infrastructure.yml
-> .github/actionspec/build-infrastructure/staging.cue
-> .github/actionspec-artifacts/build-infrastructure.json
-> target/actionspec/validation-report.json
What This Project Does
You define the expected shape of a run in CUE, collect the actual run
payload as JSON, then compare both. That is the full model.
What It Is Not
How It Works
Each step feeds the next one. Step 1 produces the contract. Step 2 produces the payload for the same workflow. Step 3 consumes both and tells you if they match.
Step 1
Write a .cue contract under .github/actionspec.
Produces: the expected contract for one workflow.
package actionspec
workflow: "ci.yml"
run: #Declaration.run & {
workflow: workflow
jobs: {
build: { result: "success" }
}
}
Step 2
Use a fixture payload, capture fragments into one payload, or capture a real CI run.
Produces: the observed payload for that same workflow.
github-actionspec capture \
--workflow ci.yml \
--job-file .github/actionspec-fragments \
--output .github/actionspec-artifacts/ci-main.json
Step 3
Validate the payload and render a report or dashboard for humans.
Consumes: the contract from step 1 and the payload from step 2.
just validate-repo-report . ci.yml \
.github/actionspec-artifacts/**/*.json \
target/actionspec/validation-report.json
Why Use It
validate-callers.Where It Runs
CLI
Use just lint, just test, and just validate-repo-report.
GitHub Action
Run emit, capture, and validate flows inside GitHub Actions with the bundled runtime.
Runtime image
Use the published runtime image when you want the CLI plus cue bundled together.
Start Small
The shortest path is: bootstrap one contract from one workflow, validate one payload locally, then wire the same flow into CI once the model is clear.