UNPKG

git-contributor-stats

Version:

CLI to compute contributor and repository statistics from a Git repository (commits, lines added/deleted, frequency, heatmap, bus-factor), with filters and multiple output formats.

1 lines 1.65 kB
{"version":3,"file":"workflow.mjs","sources":["../../src/features/workflow.ts"],"sourcesContent":["// Feature: GitHub Actions workflow generator\r\n// Separated for tree-shaking when not needed\r\n\r\nimport fs from 'node:fs';\r\nimport path from 'node:path';\r\nimport { ensureDir } from '../utils/files.ts';\r\n\r\nexport async function generateWorkflow(repo: string): Promise<void> {\r\n const wfPath = path.join(repo, '.github', 'workflows', 'git-contributor-stats.yml');\r\n ensureDir(path.dirname(wfPath));\r\n const content = `name: Git Contributor Stats\r\non:\r\n push:\r\n branches: [main]\r\n workflow_dispatch:\r\n\r\njobs:\r\n report:\r\n runs-on: ubuntu-latest\r\n steps:\r\n - uses: actions/checkout@v4\r\n - uses: actions/setup-node@v4\r\n with:\r\n node-version: '20'\r\n - name: Install deps\r\n run: npm ci || npm i\r\n - name: Run report\r\n run: npx git-contributor-stats --out-dir=./reports --html=reports/report.html --json --charts\r\n - name: Upload report\r\n uses: actions/upload-artifact@v4\r\n with:\r\n name: git-contrib-report\r\n path: reports\r\n`;\r\n fs.writeFileSync(wfPath, content, 'utf8');\r\n console.error(`Wrote sample GitHub Actions workflow to ${wfPath}`);\r\n}\r\n"],"names":[],"mappings":";;;AAOA,eAAsB,iBAAiB,MAA6B;AAClE,QAAM,SAAS,KAAK,KAAK,MAAM,WAAW,aAAa,2BAA2B;AAClF,YAAU,KAAK,QAAQ,MAAM,CAAC;AAC9B,QAAM,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBhB,KAAG,cAAc,QAAQ,SAAS,MAAM;AACxC,UAAQ,MAAM,2CAA2C,MAAM,EAAE;AACnE;"}