Skip to content

ci(dispatch): agent-authored PR body via PR_BODY.md template#36

Merged
mike-diff merged 1 commit into
mainfrom
ci-dispatch-pr-template
Jun 24, 2026
Merged

ci(dispatch): agent-authored PR body via PR_BODY.md template#36
mike-diff merged 1 commit into
mainfrom
ci-dispatch-pr-template

Conversation

@mike-diff

Copy link
Copy Markdown
Owner

Closes #none (workflow improvement, no issue).

Problem

The dispatch workflow wrote its own canned PR body (Closes #N. Generated by the dispatch workflow...), so every dispatch PR had the same generic summary regardless of what the agent actually did. The workflow cannot know what changed; only the agent can. PR #34 demonstrated the weakness: a strong code change with a boilerplate body.

Changes

  • .github/dispatch/APPEND_SYSTEM.md: added a PR_BODY.md template (Problem / Changes / How to test / Verification) the agent must follow, and an instruction not to run gh pr create itself.
  • .github/workflows/dispatch.yml: the commit/push/open-PR step now (1) reads PR_BODY.md if the agent wrote it, (2) strips it from the commit as a build artifact, (3) publishes it as the PR body, (4) falls back to a canned body if the agent produced none.

How to test

  • Next dispatch run: label an issue dispatch; the resulting PR body should have the four sections authored by the agent, not the canned summary.
  • Fallback path: if the agent fails to write PR_BODY.md, the PR body is the canned summary, and PR_BODY.md is still not committed.

Verification

go build ./... && go vet ./... && go test ./... pass. The workflow step logic was simulated in a scratch tree: PR_BODY.md is stripped from the commit, the body is preserved for publishing, source changes commit cleanly. Grounded in current PR-description guidance from GitHub docs (issue-linking keywords) and community best-practice guides (What/Why/How-tested). No em dashes per AGENTS.md.

The dispatch workflow previously wrote a canned PR body itself, so every
dispatch PR read the same generic summary regardless of what the agent did.
The workflow cannot know what changed; only the agent can.

Now the agent writes PR_BODY.md following a Problem / Changes / How to test
/ Verification template baked into APPEND_SYSTEM.md, and the workflow
publishes that file as the PR body. The workflow strips PR_BODY.md from the
commit first (it is a build artifact, not a source change) and falls back to
a canned body if the agent produced none.

Grounded in current PR-description best practice (GitHub docs + community
guides): What changed / Why / How tested, with the issue linked via the
Closes keyword.

Verified by simulating the step: PR_BODY.md is stripped, the body is
preserved for publishing, source changes commit cleanly. build/vet/test
green; no em dashes per AGENTS.md.
@mike-diff mike-diff merged commit 4f83293 into main Jun 24, 2026
2 checks passed
@mike-diff mike-diff deleted the ci-dispatch-pr-template branch June 24, 2026 01:21
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