@dotgithub/core
v0.1.5
Published
Core package for @dotgithub monorepo.
Downloads
28
Readme
@dotgithub/core
Type-safe TypeScript library for defining and generating GitHub Actions workflows using DotGitHub constructs.
What this package is
@dotgithub/core is the programmatic engine behind DotGitHub. It provides:
- strongly typed workflow models
- construct primitives for jobs/workflows/shared workflows
- generation/synthesis helpers for writing
.github/workflows/*.yml
If you want to author reusable CI/CD logic in TypeScript (instead of hand-writing YAML), this is the package you use.
Install
npm install @dotgithub/coreQuick example
import { createWorkflow } from '@dotgithub/core';
const workflow = createWorkflow({
on: {
push: { branches: ['main'] },
},
jobs: {
test: {
'runs-on': 'ubuntu-latest',
steps: [
{ uses: 'actions/checkout@v4' },
{ run: 'npm ci' },
{ run: 'npm test' },
],
},
},
});
// synthesize with your DotGitHub pipelineWhen to use @dotgithub/core vs @dotgithub/cli
- Use
@dotgithub/corefor library/SDK style usage in code. - Use
@dotgithub/cliwhen you want command-driven setup and synthesis.
Docs
- Main docs: https://github.com/azwebmaster/dotgithub#readme
- Guides: https://github.com/azwebmaster/dotgithub/tree/main/docs
- API/reference context: https://github.com/azwebmaster/dotgithub/tree/main/packages/core
