Skip to content

feat(report): emit GitHub Actions annotations for findings - #29

Merged
eleven-smg merged 1 commit into
codepacct:mainfrom
playlikeboy:feat/issue-3-github-annotations
Nov 29, 2026
Merged

eleven-smg merged 1 commit into
codepacct:mainfrom
playlikeboy:feat/issue-3-github-annotations

Conversation

@playlikeboy

Copy link
Copy Markdown
Contributor

What

Adds toGithubAnnotations(findings) in src/report.js (re-exported from src/index.js) and --format=github / --format github support in bin/codepact.js to emit ::error and ::warning workflow commands alongside the human-readable text report. When GITHUB_ACTIONS === "true" and no explicit --json, --markdown, or --format flag is given, annotations are emitted automatically without changing exit codes or corrupting JSON/Markdown/--out report files.

Why

Allows reviewers to see Codepact findings directly inline on pull request diffs in GitHub Actions without digging through raw job logs, while keeping local output and machine-readable formats unaffected. Closes #3.

Scope

  • Parser
  • Rule
  • CLI
  • Report format
  • Configuration
  • Documentation
  • Tests or CI

Verification

  • npm test passes (51/51 tests, both locally and with GITHUB_ACTIONS=true)
  • npm run check:clean exits 0
  • npm run check:broken exits non-zero (exit code 1)
  • New behaviour has a test or a documented reason it cannot have one

Notes for review

  • Workflow command message data escapes % (%25), \r (%0D), and \n (%0A), and property values (file, line) additionally escape : (%3A) and , (%2C).
  • Invalid --format values and conflicting combinations with --json or --markdown exit with code 2.
  • Parser, analyzer rules, configuration, and baseline logic were not modified.

@eleven-smg
eleven-smg merged commit c73b0e3 into codepacct:main Nov 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit GitHub Actions annotations so findings appear inline on the diff

2 participants