@stackbilt/ci 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +88 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @stackbilt/ci
2
+
3
+ GitHub Actions integration helpers for [Charter Kit](https://github.com/Stackbilt-dev/charter) -- a local-first governance toolkit for software repos.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @stackbilt/ci
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Write Actions outputs and summaries
14
+
15
+ ```ts
16
+ import { setOutput, setSummary } from '@stackbilt/ci';
17
+
18
+ setOutput('governance-status', 'PASS');
19
+ setSummary('## Governance check passed\nNo violations detected.');
20
+ ```
21
+
22
+ ### Annotate drift violations
23
+
24
+ ```ts
25
+ import { annotateDriftViolations } from '@stackbilt/ci';
26
+
27
+ // Emits ::warning:: or ::error:: annotations inline on PR diffs.
28
+ // BLOCKER/CRITICAL severity = error; others = warning.
29
+ annotateDriftViolations(violations);
30
+ ```
31
+
32
+ ### Annotate validation status
33
+
34
+ ```ts
35
+ import { annotateValidationStatus } from '@stackbilt/ci';
36
+
37
+ annotateValidationStatus('FAIL', 'Missing required Governed-By trailer');
38
+ ```
39
+
40
+ ### Format a PR comment
41
+
42
+ ```ts
43
+ import { formatPRComment } from '@stackbilt/ci';
44
+
45
+ const body = formatPRComment({
46
+ status: 'WARN',
47
+ summary: '2 drift violations detected',
48
+ violations,
49
+ suggestions: ['Pin axios to the blessed version'],
50
+ score: 0.85,
51
+ });
52
+ ```
53
+
54
+ ## API Reference
55
+
56
+ ### `setOutput(name, value): void`
57
+
58
+ Appends `name=value` to `$GITHUB_OUTPUT`. No-op outside Actions.
59
+
60
+ ### `setSummary(markdown): void`
61
+
62
+ Appends markdown to `$GITHUB_STEP_SUMMARY`. No-op outside Actions.
63
+
64
+ ### `annotateDriftViolations(violations: DriftViolation[]): void`
65
+
66
+ Emits `::error::` / `::warning::` for each violation with file and line number.
67
+
68
+ ### `annotateValidationStatus(status, summary): void`
69
+
70
+ Emits `::error::` for FAIL, `::warning::` for WARN, nothing for PASS.
71
+
72
+ ### `formatPRComment(result): string`
73
+
74
+ Formats governance results as a markdown PR comment with status, violations table (max 20), and suggestions.
75
+
76
+ ## Requirements
77
+
78
+ - Node >= 18
79
+ - Peer dependency: `@stackbilt/types`
80
+
81
+ ## License
82
+
83
+ Apache-2.0
84
+
85
+ ## Links
86
+
87
+ - [Repository](https://github.com/Stackbilt-dev/charter)
88
+ - [Issues](https://github.com/Stackbilt-dev/charter/issues)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackbilt/ci",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "GitHub Actions adapter for Charter governance checks",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",