Repository navigation
feat: initial implementation of github-actions-annotations-reporter - #2
Merged
Merged
Conversation
The 4 KiB per-field cap is measured with `text.length`, which counts UTF-16 code units. Renaming `MAX_RENDERED_FIELD_BYTES → CHARS` and the truncation marker's "more bytes → more characters" makes the units match the measurement. JSON output is still uncapped. Also fix the ANSI-strip regex in the test helper: the previous pattern matched `\[[0-9;]*m` without the leading ESC byte (the file had a literal 0x1B that survived only because `toContain` doesn't compare exactly). Switch to `�\[[0-9;]*m` so the helper survives an exact-match assertion later.
`release.yml`, `self-check.yml`, `deploy-docs.yml`, and `action-selftest.yml` already pin `actions/checkout`, `actions/setup-node`, and `pnpm/action-setup` at `@v6`; only `ci.yml` was on `@v4`. Aligning the majors cuts Dependabot noise and removes a silent inconsistency.
The comment justified clearing GH_TOKEN as well, but only GITHUB_REPOSITORY was stubbed. Stub all three so the "no repo" branch is exercised regardless of the host shell's auth env.
`state.issues.at(-1)?.number + 1` assumed appended-in-order numbering.
Tests that seed issues with hand-picked, out-of-order numbers (e.g.
`{number: 6}` then `{number: 5}`) could silently collide on `create`.
Switch to `Math.max(0, ...state.issues.map(i => i.number)) + 1`.
`IssueState` is re-exported by `src/index.ts` and nothing imports it from this module. Drop the dangling re-export and stale comment.
`String(workflowLatestRun.conclusion)` rendered a null conclusion as the literal text `"null"` inside quotes, which was misleading. Match the listing renderer's convention and substitute `(no conclusion)` instead.
`Number.parseInt('abc', 10)` returns `NaN`, which slipped through the
`typeof n === 'number'` check in `shared.ts` and only surfaced much
later as a generic zod "Expected number, received nan" — far from the
flag that produced it. Throwing `InvalidArgumentError` in the coercer
gives users a precise, locally-attributed error against the offending
flag.
Applies to `--max-issues`, `--auto-close-after-days`, and
`--auto-close-after-misses`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A TypeScript/Node CLI (
ghaar) and composite GitHub Action that scansGitHub Actions workflow run annotations across the latest run per
workflow, files dedup-aware GitHub Issues, and auto-closes them when
the underlying annotation vanishes.
Core domain
normalized message); line numbers excluded so refactors don't spawn
duplicates.
--min-severityfilter and matching
severity/<level>labels.of three signals match — configured label (default
wontfix),state_reason: not_planned, or a regex against the closing comment.counter AND age window, and (by default) the source workflow's
latest run to have succeeded. Reopens automatically if the
annotation returns.
CLI / Action surfaces
ghaar scan/report/listcommands with shared options.--list-annotationsprints fielded blocks per annotation and addsa full
annotations[]array to the JSON report.--jsonmodes; force off with--no-progress).action.ymlwith a hardened bash dispatcher (versionallowlist, env-var staging, args array,
mktempreport path).Scaffolding
coverage thresholds; 137 tests passing.
generated CLI reference via `pnpm docs:gen-cli`.
GitHub App auth, and a floating `v` tag.
deploy workflow.