Repository navigation
[CLI] Create GH action and badge for CommonGrants compliance #335
Description
Summary
Provide a GitHub Action that runs cg check spec, outputs a compliance score, and publishes a repo-friendly compliance badge (SVG) plus an actionable report for PRs and CI/CD.
What problem are we solving?
Today, cg check spec is all-or-nothing and its results aren’t easily shared. Teams want a visible, low-friction way to track progress (e.g., “92% compliant”), fail builds only when below a threshold, and surface issues directly in PRs—without adding servers, SSR, or hosted services.
What do we propose?
Deliver a first-party GitHub Action (commongrants/check-spec-action) that:
- Runs
cg check specwith the new configurable threshold, strictness, and ignore settings. - Computes and outputs a compliance percentage (e.g., 92.4%).
- Publishes a badge without any backend:
- Option A: Write a static SVG badge (
/badges/cg-compliance.svg) to the repo (via a bot commit or artifacts), which you can embed in README/docs. - Option B: Emit a small JSON endpoint file (
/badges/cg-compliance.json) that Shields.io can read via itsendpointfeature (e.g., usingraw.githubusercontent.com).
- Option A: Write a static SVG badge (
- Annotates PRs: with a summary table and (optionally) GitHub Check annotations for errors/warnings.
- Fails the job only if compliance is below the configured threshold (default 100%).
Why does it matter to CommonGrants adopters?
The badge makes compliance visible and motivational. The Action encourages incremental adoption (tune threshold over time), improves developer ergonomics (PR comments and checks), and is zero-infrastructure, it works entirely within GitHub.
Effort and dependencies
- Moderate effort: ~2 sprints
- Dependencies: Configurable validation
Acceptance criteria
- A public GitHub Action (
commongrants/check-spec-action) that runscg check spec, outputs compliance %, and respects config (threshold, severities, ignored rules). - Action supports static badge publishing (SVG committed/updated in repo) and Shields endpoint JSON output.
- Action posts a PR summary (compliance %, top failing rules), and optionally creates check annotations for errors/warnings.
- Example workflows + README snippets show how to embed the badge and tune thresholds over time.
Fider
- Vote for this feature: Post
- Votes: 5
Dependencies
Here are the upstream and downstream dependencies for this issue:
flowchart LR
%% ─────────────────────────────
%% Styles
%% ─────────────────────────────
classDef default fill:#fff,stroke:#333,stroke-width:1px,color:#000,rx:5,ry:5
classDef InProgress fill:#e1f3f8,stroke:#07648d,stroke-width:2px,color:#000
classDef Done fill:#8DE28D,stroke:#204e34,stroke-width:3px,color:#000
style Canvas fill:transparent,stroke:#171716
style Legend fill:#F7F7F4,stroke:#171716
%% ─────────────────────────────
%% Legend
%% ─────────────────────────────
subgraph Legend["Key"]
direction LR
k1["Todo"]
k2["In progress 🛠️ "]:::InProgress
k3["Done ✔️"]:::Done
k1 -.-> k2 -.-> k3
end
%% ─────────────────────────────
%% Main canvas
%% ─────────────────────────────
subgraph Canvas["Dependencies"]
direction LR
HHS/simpler-grants-protocol#335["Create GH action and badge for CommonGrants compliance"]
HHS/simpler-grants-protocol#331["Make API spec validation configurable"]
%% ─────────────────────────────
%% Relationships
%% ─────────────────────────────
HHS/simpler-grants-protocol#331 --> HHS/simpler-grants-protocol#335
end
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
[-][CLI] Create GH action and badge for API spec validation[/-][+][CLI] Create GH action and badge for CommonGrants compliance[/+]