You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
action.yml's only step that produces user-facing output is archguard check --ci (action.yml:37-39), which writes to the job's stdout log. On a pull request, nobody sees a violation unless they open the CI log — there's no summary posted where the PR is actually being reviewed, unlike tools (CodeQL, most linters-as-Actions) that comment directly on the PR.
Acceptance Criteria
action.yml gains a new opt-in input, e.g. comment-on-pr (boolean, default false), so existing consumers' workflows are unaffected and nobody is silently granted extra GitHub permissions they didn't ask for.
When comment-on-pr: true and the workflow is running on a pull_request event, a step posts (or updates, if one already exists from a prior run on the same PR — don't spam a new comment per push) a comment summarizing violations found by the archguard check --ci step.
README and action.yml's input description both state that comment-on-pr: true requires the consumer's workflow to grant permissions: pull-requests: write (composite actions inherit the caller's token permissions and cannot request their own) — a bare uses: Tgenz1213/ArchGuard@main example in the README should show the required permissions: block.
If comment-on-pr: true is set on a non-pull_request trigger (e.g. a push to main), the step is skipped without failing the run.
Comment content is at minimum the same information already in the CI log for violations (ADR, file, line, reasoning) — reasonable to build on --format json (issue feat: Add machine-readable (--format json) output to archguard check #70) once available for a cleaner comment body, but that's an enhancement, not a blocker for v1.
Related
Depends loosely on #70 (--format json) for a well-structured comment body; v1 can parse/reuse the existing text output if #70 isn't done yet.
Problem
action.yml's only step that produces user-facing output isarchguard check --ci(action.yml:37-39), which writes to the job's stdout log. On a pull request, nobody sees a violation unless they open the CI log — there's no summary posted where the PR is actually being reviewed, unlike tools (CodeQL, most linters-as-Actions) that comment directly on the PR.Acceptance Criteria
action.ymlgains a new opt-in input, e.g.comment-on-pr(boolean, defaultfalse), so existing consumers' workflows are unaffected and nobody is silently granted extra GitHub permissions they didn't ask for.comment-on-pr: trueand the workflow is running on apull_requestevent, a step posts (or updates, if one already exists from a prior run on the same PR — don't spam a new comment per push) a comment summarizing violations found by thearchguard check --cistep.action.yml's input description both state thatcomment-on-pr: truerequires the consumer's workflow to grantpermissions: pull-requests: write(composite actions inherit the caller's token permissions and cannot request their own) — a bareuses: Tgenz1213/ArchGuard@mainexample in the README should show the requiredpermissions:block.comment-on-pr: trueis set on a non-pull_requesttrigger (e.g. a push to main), the step is skipped without failing the run.--format json(issue feat: Add machine-readable (--format json) output to archguard check #70) once available for a cleaner comment body, but that's an enhancement, not a blocker for v1.Related
Depends loosely on #70 (
--format json) for a well-structured comment body; v1 can parse/reuse the existing text output if #70 isn't done yet.