Skip to content

Commit ac4da02

Browse files
committed
feat: structured output for step log, job summary, and PR comments
Collect results via commit-check --format json and render all three output surfaces from the structured data instead of scraping plain text: - step log: grouped sections with ::error annotations per rule ID - job summary: policy report table with rule links and collapsible details - PR comment: compact table with rule links and collapsible details - new result output exposing structured JSON for downstream jobs
1 parent fe4835e commit ac4da02

4 files changed

Lines changed: 768 additions & 464 deletions

File tree

‎README.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,28 @@ for all available options.
201201
> [Optional Inputs](#optional-inputs), so env vars and config files are the
202202
> recommended way to customize.
203203

204+
## Outputs
205+
206+
### `result`
207+
208+
Structured check results as JSON, available to downstream steps via
209+
[`fromJSON`](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#fromjson):
210+
211+
```yaml
212+
- uses: commit-check/commit-check-action@v2
213+
id: commit-check
214+
215+
- name: Inspect results
216+
run: |
217+
echo "Status: ${{ fromJSON(steps.commit-check.outputs.result).status }}"
218+
echo "Scopes: ${{ toJSON(fromJSON(steps.commit-check.outputs.result).scopes) }}"
219+
```
220+
221+
Each scope carries the check outcomes (`rule_id`, `check`, `status`, `value`,
222+
`error`, `suggest`, `docs_url`) exactly as produced by
223+
`commit-check --format json`, so downstream jobs can build their own reports
224+
or gate on individual rules.
225+
204226
## GitHub Action Job Summary
205227

206228
By default, commit-check-action results are shown on the job summary page of the workflow.

‎action.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ inputs:
3737
description: check pull request title following conventional commits
3838
required: false
3939
default: false
40+
outputs:
41+
result:
42+
description: Structured check results as JSON (status + per-scope checks). Consume with `${{ fromJSON(steps.<id>.outputs.result) }}`.
43+
4044
runs:
4145
using: "composite"
4246
steps:

0 commit comments

Comments
 (0)