-
-
Notifications
You must be signed in to change notification settings - Fork 4
README
Lisa edited this page Jan 5, 2026
·
2 revisions
Ready-to-use templates for CI/CD integration and local development hooks.
| I want to... | Use this |
|---|---|
| Post a simple PR comment | impact-comment.yml |
| Full workflow with risk gates | impact-analysis.yml |
| Org-wide reusable workflow | ckb-reusable.yml |
| Scheduled index refresh | ckb-refresh.yml |
| Use GitLab CI | ckb.yml |
| Local pre-commit hook | pre-commit |
# GitHub Actions - Simple PR comment
curl -o .github/workflows/impact-comment.yml \
https://raw.githubusercontent.com/SimplyLiz/CodeMCP/main/examples/github-actions/impact-comment.yml
# GitHub Actions - Full workflow
curl -o .github/workflows/impact-analysis.yml \
https://raw.githubusercontent.com/SimplyLiz/CodeMCP/main/examples/github-actions/impact-analysis.yml
# GitLab CI
curl -o .gitlab/ci/ckb.yml \
https://raw.githubusercontent.com/SimplyLiz/CodeMCP/main/examples/gitlab-ci/ckb.yml
# Pre-commit hook
curl -o .git/hooks/pre-commit \
https://raw.githubusercontent.com/SimplyLiz/CodeMCP/main/examples/hooks/pre-commit
chmod +x .git/hooks/pre-commitexamples/
├── github-actions/
│ ├── impact-comment.yml # Simple PR comment widget
│ ├── impact-analysis.yml # Full workflow with risk gates
│ ├── ckb-reusable.yml # Reusable workflow for org-wide use
│ └── ckb-refresh.yml # Scheduled architecture refresh
├── gitlab-ci/
│ └── ckb.yml # GitLab CI template (include in your pipeline)
└── hooks/
├── pre-commit # Git pre-commit hook (bash)
├── pre-commit-config.yaml # pre-commit framework config
└── husky/
├── pre-commit # Husky pre-commit hook
└── ckb-check.js # Complexity check for lint-staged
Minimal setup - just post impact analysis as a PR comment:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
npm install -g @tastehub/ckb
ckb index --if-stale=24h
ckb impact --range="${{ github.event.pull_request.base.sha }}..${{ github.sha }}" \
--format=markdown > impact.md
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: ckb-impact
path: impact.mdComplete integration with:
- Risk gates (fail on critical)
- Automatic reviewer assignment
- PR comments with impact summary
- Caching for faster runs
For organizations - create once, use everywhere:
# In your app repo
jobs:
ckb:
uses: your-org/workflows/.github/workflows/ckb-reusable.yml@main
with:
risk-threshold: 'high'Include the template in your .gitlab-ci.yml:
include:
- local: '.gitlab/ci/ckb.yml'
stages:
- .pre
- test
- buildFeatures:
- MR notes with impact analysis
- Affected tests detection
- Scheduled architecture refresh
- Artifact storage
cp examples/hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commitBlocks commits with critical risk, warns on high risk.
pip install pre-commit
cp examples/hooks/pre-commit-config.yaml .pre-commit-config.yaml
pre-commit installnpm install -D husky lint-staged
npx husky init
cp examples/hooks/husky/pre-commit .husky/pre-commit
cp examples/hooks/husky/ckb-check.js scripts/ckb-check.js
chmod +x .husky/pre-commit scripts/ckb-check.jsAdd to package.json:
{
"lint-staged": {
"*.{ts,tsx}": ["node scripts/ckb-check.js"]
}
}- Impact Analysis - Full feature documentation
- CI/CD Integration - CI/CD overview
- Configuration - CKB configuration options