Skip to content

GitHub Actions

Canon ships a suite of GitHub Actions you can drop into your existing CI/CD pipelines. They complement the GitHub App without requiring it — you can use Actions, the App, or both.

Why Actions?

The GitHub App handles conversational PR analysis, doc indexing, @canon mentions, and realization tracking. Actions fill four gaps the App can't cover by design:

GapWhy Actions help
Merge gatingActions emit standard check-runs that branch-protection rules can mark required. The App posts comments; Actions block merges.
Cron semanticsActions run on schedule: triggers without any backend dependency. The drift audit action is the canonical use case.
No app installSome orgs can't or won't install third-party apps. Actions run inside your own workflows with permissions you control.
ComposabilityActions plug into your existing multi-step pipelines with uses: and reusable workflows — no separate integration to maintain.

The suite at a glance

ActionPurposeNeeds Canon backend?
canonhq/canon@v1Setup CanonInitialize a new repo with CANON.yaml and the spec templateNo
canonhq/canon/actions/spec-lint@v1Validate spec file structure (frontmatter, sections, ACs)No
canonhq/canon/actions/verify@v1Static AC-vs-code verification with check-run emissionNo
canonhq/canon/actions/coverage-report@v1Publish a coverage snapshot to a file, issue, or webhookNo
canonhq/canon/actions/coverage-delta@v1Per-PR base-vs-head coverage diff with sticky commentNo
canonhq/canon/actions/audit@v1Claude-powered drift detection — rolling issue, PR, or step summaryRecommendedCANON_TOKEN
canonhq/canon/actions/sync@v1CI-side ticket sync (GitHub Issues / Jira / Linear) using workflow secretsNo
canonhq/canon/actions/release-notes@v1Spec-driven release notes from git history — auto-update GitHub Release bodyNo
canonhq/canon/actions/plan@v1Generate a task plan from a spec, open a tracking issueNo
canonhq/canon/actions/new-spec@v1Scaffold a new spec from a template, open a PRNo
canonhq/canon/actions/dedup@v1Find and report duplicate tickets — scheduled cleanup hygieneNo
canonhq/canon/actions/stale-spec-check@v1Find specs whose code has churned but the spec hasn'tNo
canonhq/canon/actions/compliance-export@v1Export an audit trail of every AC for regulated environmentsNo
canonhq/canon/actions/upgrade@v1Bump the pinned canonhq CLI version (Dependabot-but-canon-aware)No

Reusable workflows bundle several actions into a single uses: line:

Reusable workflowBundles
pr-checks.ymlspec-lint + verify + coverage-delta
weekly-audit.ymlaudit + coverage-report

The lint → verify → audit ladder

Three layers of checking, each cheaper than the next, each catching different problems:

LayerWhat it checksSpeedClaude?When to run
canon lintSpec file structure: frontmatter, section numbering, AC format, comment syntax, depends_on resolvabilitymillisecondsnoEvery PR
canon verifyWhether ACs have grep-detectable evidence in the codebasesecondsnoEvery PR
canon auditAI-evaluated drift between code reality and spec statusesminutesyesWeekly cron

The general rule: lint + verify on PRs (cheap, blocking), audit on a schedule (expensive, advisory). The reusable pr-checks workflow is the recommended PR-time bundle. The audit action will be the recommended schedule-time job once it ships.

Authentication

Most actions need no authentication beyond the workflow's built-in GITHUB_TOKEN. Two exceptions:

  • audit action (when shipped) needs a CANON_TOKEN GitHub secret that the action uses to call the Canon backend. Claude spend stays on your Canon org bill, not on a personal Anthropic account.
  • Self-hosted Canon backend: pass canon-api-url to point any Claude-using action at your own deployment instead of https://api.canonhq.co.

To create a Canon token, run canon auth tokens create --name <name> locally or use the dashboard. See Self-hosting for backend setup details.

Quick start

The simplest possible setup — opt in to PR linting and verification with one block in your repo's .github/workflows/:

yaml
# .github/workflows/canon.yml
name: Canon PR Checks

on:
  pull_request:
    branches: [main]

jobs:
  canon:
    uses: canonhq/canon/.github/workflows/reusable/pr-checks.yml@v1
    with:
      fail-on-lint: error

That's it. On every PR you'll get two check-runs (Spec Lint and Verify ACs) you can mark required in branch protection.

For more recipes — scheduled coverage snapshots, Slack notifications, custom configurations — see the recipes page.

Versioning

The action suite is versioned in lock-step with the Canon CLI. Every canon-private release tags the public canonhq/canon repo with the matching v<major>.<minor>.<patch> and updates the floating v<major> tag (e.g. v1). For predictable behavior, pin to a major version (canonhq/canon@v1); for reproducible builds, pin to a specific patch (canonhq/canon@v1.46.0).

AI-native enterprise documentation platform.