Getting Started
1. Install
Section titled “1. Install”mkdir my-project && cd my-projectnpm init -ynpm install --save-dev @intentius/chant @intentius/chant-lexicon-github typescript2. Create your workflow
Section titled “2. Create your workflow”Create src/ci.ts:
import { Workflow, Job, Step, Checkout, SetupNode } from "@intentius/chant-lexicon-github";
export const workflow = new Workflow({ name: "CI", on: { push: { branches: ["main"] }, pull_request: { branches: ["main"] }, }, permissions: { contents: "read" },});
export const build = new Job({ "runs-on": "ubuntu-latest", timeoutMinutes: 15, steps: [ Checkout({}).step, SetupNode({ nodeVersion: "22", cache: "npm" }).step, new Step({ name: "Install", run: "npm ci" }), new Step({ name: "Build", run: "npm run build" }), new Step({ name: "Test", run: "npm test" }), ],});3. Build
Section titled “3. Build”chant build src/ --output .github/workflows/ci.ymlThis produces .github/workflows/ci.yml:
name: CIon: push: branches: - main pull_request: branches: - mainpermissions: contents: readjobs: build: runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: npm - name: Install run: npm ci - name: Build run: npm run build - name: Test run: npm test4. Lint
Section titled “4. Lint”chant lint src/Lint checks for common issues — missing timeouts, hardcoded secrets, raw expression strings, and more. See the Lint Rules page for the full list.
5. Deploy
Section titled “5. Deploy”Commit the generated YAML and push:
git add .github/workflows/ci.ymlgit commit -m "Add CI workflow"git pushGitHub automatically picks up any .github/workflows/*.yml files and runs them on the configured triggers.
Next steps
Section titled “Next steps”- Workflow Concepts — resource types, triggers, permissions
- Expressions — typed expression system and condition helpers
- Composites — pre-built action wrappers (Checkout, SetupNode, etc.)
- Lint Rules — 13 lint rules and 6 post-synth checks