feat(core,github-action,github): support custom changelog preamble#187
Open
dangreen wants to merge 1 commit into
Open
feat(core,github-action,github): support custom changelog preamble#187dangreen wants to merge 1 commit into
dangreen wants to merge 1 commit into
Conversation
Inject custom markdown into the changelog after the version header via a new bump.preamble option (config or JS API), or a !simple-release/set-preamble pull request comment — globally or per package through byProject.
Coverage Report for CI Build 29292523859Coverage decreased (-0.9%) to 62.199%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for a user-defined changelog “preamble” (markdown inserted immediately after the version header), configurable via JS/config (bump.preamble, bump.byProject[name].preamble) and via a new PR comment command (!simple-release/set-preamble).
Changes:
- Extend core bump options and changelog template context to carry a
preamble, and suppress the “Version bump without any changes.” fallback when a preamble exists. - Add GitHub Action support for parsing
!simple-release/set-preamblecomments (global + per-package) and applying them to bump options. - Update docs/cheatsheet and add tests for preamble rendering and comment parsing.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| website/src/content/docs/js-api/releaser.mdx | Documents new bump.preamble option (and monorepo usage). |
| website/src/content/docs/github-action/release-automation.mdx | Documents !simple-release/set-preamble usage for PR comments. |
| skills/setup-simple-release-action/SKILL.md | Updates setup guidance to mention the new comment command. |
| packages/github/src/cheatsheet.ts | Adds cheatsheet section for set-preamble and updates restrictions/notes wording. |
| packages/github-action/src/releaser.ts | Scans PR comments for preambles and merges them into bump options. |
| packages/github-action/src/conditions.ts | Triggers comment-driven runs for both set-options and set-preamble. |
| packages/github-action/src/comment.ts | Adds set-preamble command parsing and exports COMMANDS. |
| packages/github-action/src/comment.spec.ts | Adds vitest coverage for set-preamble parsing behavior. |
| packages/core/src/project/project.types.ts | Adds preamble?: string to ProjectBumpOptions. |
| packages/core/src/project/project.ts | Passes preamble into changelog template context. |
| packages/core/src/project/packageJsonMonorepo.spec.ts | Tests global vs per-project preamble behavior in monorepos. |
| packages/core/src/project/packageJson.spec.ts | Tests insertion position and placeholder suppression for preamble. |
| packages/core/src/project/monorepo.types.ts | Allows preamble in byProject bump options typing. |
| packages/core/src/change-log.ts | Suppresses “no changes” placeholder when a preamble exists. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+64
to
+68
| const preamble = newlineIndex === -1 | ||
| ? '' | ||
| : body.slice(newlineIndex + 1).trim() | ||
|
|
||
| if (preamble) { |
| | `prerelease` | Pre-release identifier for prerelease bumps. | | ||
| | `snapshot` | Pre-release identifier with a timestamp suffix for [snapshot builds](/github-action/snapshot-release/). Always applied when set. | | ||
| | `skipChangelog` | Update versions without generating the changelog. | | ||
| | `preamble` | Custom markdown inserted into the changelog after the version header, before the generated sections. In a monorepo it applies to every package; set it per package with `byProject`. | |
| * comment event but not a command comment, or `null` when it is not a comment | ||
| * event at all. | ||
| */ | ||
| export function ifSetOptionsComment() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for a custom changelog preamble — arbitrary markdown inserted into the changelog right after the version header, before the generated sections.
Usage
Config / JS API — a new
bump.preambleoption; per package in a monorepo viabump.byProject[name].preamble.Pull request comment —
!simple-release/set-preamblefollowed by the markdown. In a monorepo, pass the full package name (in backticks so GitHub keeps it as text) to target one package:Multiple per-package comments coexist (newest per package wins); one comment without a name sets a global preamble for the whole release. The command honors the same owner/member/collaborator restriction as
set-options.Notes
preamblePartial—Project.bumpjust started populating the changelog context'spreamble. Per-package targeting reusesbump.byProject(keyed by full package name).@simple-release/github-actiondependency.