Skip to content

Getting Started

Terminal window
mkdir my-project && cd my-project
npm init -y
npm install --save-dev @intentius/chant @intentius/chant-lexicon-github typescript

Create src/ci.ts:

quickstart.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" }),
],
});
Terminal window
chant build src/ --output .github/workflows/ci.yml

This produces .github/workflows/ci.yml:

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
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 test
Terminal window
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.

Commit the generated YAML and push:

Terminal window
git add .github/workflows/ci.yml
git commit -m "Add CI workflow"
git push

GitHub automatically picks up any .github/workflows/*.yml files and runs them on the configured triggers.

  • 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