Skip to content

GitHub Actions

The GitHub Actions lexicon provides typed constructors for GitHub Actions workflow configuration. It covers workflows, jobs, steps, triggers, strategy, permissions, concurrency, and more.

Install it with:

Terminal window
npm install --save-dev @intentius/chant-lexicon-github
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" }),
],
});

The lexicon provides 2 resources (Workflow, Job), 13 composites (Checkout, SetupNode, SetupGo, SetupPython, CacheAction, UploadArtifact, DownloadArtifact, NodeCI, NodePipeline, PythonCI, DockerBuild, DeployEnvironment, GoCI) + 3 presets (BunPipeline, PnpmPipeline, YarnPipeline), a typed Expression system with 24 GitHub and 5 Runner context variables, and 13 lint rules + 6 post-synth checks.

MetricCount
Resources3
Property types19
Services1
Intrinsic functions1
Pseudo-parameters0
Lint rules28

Lexicon version: 0.1.7
Namespace: GitHub