Changelog

Keep a CHANGELOG in sync with what ships. When a pull request is merged, one agent drafts the changelog entry it implies and opens a small PR that adds it, so the changelog never falls behind the code.

The steps

1 step in workflows/changelog/. The trigger is the built-in Github.PullRequestMerged event.

entry.md
---
on: Github.PullRequestMerged
agent: Scribe
output: { pr_url: url, entry: str }
emits: ChangelogUpdated
---
PR #{{ event.number }} ("{{ event.title }}") was merged by
{{ event.merged_by }}. Record it in the changelog.

1. Read what the PR changed (its merge commit / diff).
2. Write one changelog line in the repo's existing style; create
   CHANGELOG.md if there isn't one. Skip purely internal changes.
3. Branch, commit, push, and open a PR against the default branch.

Return the PR URL (empty if skipped) and the entry text.

The trigger

The built-in Github.PullRequestMerged event, named directly in on:. The code review example reacts to a PR opening; this one turns each merge into a documentation change. No sensor and no events: entry for the trigger.

The token

This workflow writes, so it needs git write access: a GitHub App via loopy auth github, or a GITHUB_TOKEN with contents:write + pull_requests:write in the sandbox's env file.

From the registry

Only the outbound ChangelogUpdated event needs declaring.

registry.yml
agents:
  Scribe: {}  # drafts the changelog entry and opens the PR

events:  # outbound only; Github.PullRequestMerged is built in
  ChangelogUpdated:
    pr_url: url
    entry: str
open on github → back to overview