Skip to content

ci: post the discipline sentinel report as a PR comment - #219

Merged
orieg merged 1 commit into
mainfrom
chore/discipline-comment
Oct 7, 2026
Merged

orieg merged 1 commit into
mainfrom
chore/discipline-comment

Conversation

@orieg

@orieg orieg commented Oct 7, 2026

Copy link
Copy Markdown
Owner

What

Turns on the discipline action's comment: true input on the Discipline Sentinel job (.github/workflows/ci.yml).

Why

Reviewers currently see the sentinel verdict only in the job log / step summary. With comment: true, the full report is posted as one pull-request comment, edited on every run — the verdict lands on the thread automatically.

Changes

  • comment: true on the sentinel step
  • discipline job permissions: pull-requests: read → write (comment posting)
  • persist-credentials: false on the job's checkout: the discipline action reads the forge through DISCIPLINE_FORGE_TOKEN (env), not git credentials, so the token is kept out of .git/config now the job can write (flagged by the v0.15+ ci-integrity checkout-persists-credentials finding — itself a new-gate catch from the ci: bump discipline action pins from v0.14.4 to v0.18.0 #218 bump)
  • Fork behavior unchanged and safe: a fork's read-only token is reported, not failed

Validation

  • Local v0.18.0 discipline check --base origin/main: PASS (27 gates, 0 errors, 0 warnings, 0 overrides)
  • Workflow YAML parses

The ci-integrity checkout-persists-credentials finding this change initially tripped is resolved by the persist-credentials: false above; note the bump in #218 is what armed that finding.

Enable the discipline action's comment:true input on the Discipline
Sentinel job. The full report is now posted as one pull-request
comment, edited on every run, so reviewers see the verdict on the
thread instead of chasing the job log. The job's pull-requests
permission goes read -> write, so its checkout must not persist
credentials (DISCIPLINE_FORGE_TOKEN carries the token in env); a
fork's read-only token is reported, not failed, so comment posting
can never block a fork pull request.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

discipline: passed

Base main (origin/main) (merge base b22268e623) · 27 gate(s) passed · 2159 item(s) examined · 0 warning(s) · 0 override(s)

discipline explain <gate> prints what a gate checks and how a finding is lifted. This comment is updated on every run; the check's status is the verdict.

@orieg
orieg merged commit 33066a3 into main Oct 7, 2026
18 checks passed
@orieg
orieg deleted the chore/discipline-comment branch October 7, 2026 21:06
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.

1 participant