Skip to content

fix: preserve PR body enforcement outcome - #69

Merged
wibus-wee merged 1 commit into
mainfrom
fix/pr-body-comment-permissions
Aug 27, 2026
Merged

fix: preserve PR body enforcement outcome#69
wibus-wee merged 1 commit into
mainfrom
fix/pr-body-comment-permissions

Conversation

@wibus-wee

@wibus-wee wibus-wee commented Aug 27, 2026

Copy link
Copy Markdown
Member

Author type

  • I am an Agent (check this if an LLM agent authored this PR)
  • I am a human

Problem / pressure

An invalid external PR correctly failed body validation, but the notification step received a 403 while commenting and masked the intended enforcement step. The failure path needs the same effective PR permissions as the working scope-label workflow, and feedback delivery must not decide the policy result.

Summary

  • Grant the PR body workflow pull-requests: write so it can create, update, and remove its marker comment on pull requests.
  • Treat notification and cleanup as best-effort feedback.
  • Run the final invalid-body failure under always() so checker output remains the source of truth even when feedback fails.
  • Record the permission and outcome-separation invariant in .github/AGENTS.md.

Before / after

Before After
A comment API 403 stopped the job before the explicit enforcement step, obscuring the real invalid-body result. Comment management has the required PR permission and cannot mask or override the checker result.

Test plan

Agent handoff

Instructions for reviewing agents

  • Review focus: Verify the added PR write scope is necessary and remains safe with trusted-base checkout; confirm feedback failures cannot change the checker outcome.
  • Decisions to challenge: Challenge retaining both Issues and Pull requests write permissions, using best-effort comment steps, and applying always() only to the final enforcement step.
  • Plausible failures / evidence gaps: GitHub may still reject fork-PR comments due to a higher-level policy; broader PR permission becomes dangerous if future edits execute fork code; live comment recovery cannot be exercised before merge.

Authoring context

  • User goal / directives: Diagnose the Actions failure and open a new formal PR that fixes the confirmed PR-body workflow problem.
  • Constraints / non-goals: Preserve external PR enforcement, never execute fork code with the write-capable token, and keep this fix separate from the already merged contribution automation PR.
  • Risk-bearing decisions: Expand Pull requests from read to write and make comment management best-effort while checker output exclusively controls enforcement.
  • Destructive or irreversible behavior: The workflow may create, update, or delete only its own marker comment; no product or user data changes.
  • Deliberately not done or tested: No repository Actions settings or action versions were changed; a live invalid fork PR cannot validate comment creation until this workflow reaches the default branch.
  • Unknowns / confidence: Static workflow, formatting, public-boundary, and real-body regressions pass; the working label workflow with the same write scopes supports the permission diagnosis.

Sharing consent (author side)

Declining context sharing is respected, but it does not guarantee review. If withheld context prevents maintainers from assessing provenance, scope, or risk, they may decline the contribution or close the pull request.

  • Author-side user explicitly allowed publishing the Authoring context above
  • Author-side user explicitly declined publishing Authoring context and understands that maintainers may decline or close the contribution; keep every field as N/A / redacted

@wibus-wee
wibus-wee merged commit 5d80d67 into main Aug 27, 2026
3 checks passed
@wibus-wee
wibus-wee deleted the fix/pr-body-comment-permissions branch August 27, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant