Skip to content

Add changelog generation integrated into the release process - #2

Closed
Priestch with Copilot wants to merge 2 commits into
mainfrom
copilot/add-changelog-workflow
Closed

Add changelog generation integrated into the release process#2
Priestch with Copilot wants to merge 2 commits into
mainfrom
copilot/add-changelog-workflow

Conversation

Copilot AI commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Adds automatic changelog generation from conventional commits, integrated directly into the existing scripts/release.js release flow, and a GitHub Actions workflow that publishes the changelog as a GitHub Release when a tag is pushed.

scripts/release.js

New functions wired into the release sequence (runs after version bump, before build):

  • getLastTag(pkgName) — finds the most recent <pkg>-v* tag
  • getCommitsSince(tag, pkgDir) — fetches commits since last tag, scoped to the package path (monorepo-safe)
  • parseConventionalCommit — parses type(scope)!: description format
  • generateChangelogEntry — groups commits into Keep-a-Changelog markdown sections (Breaking Changes, Features, Bug Fixes, etc.)
  • updateChangelog — prepends new entry to CHANGELOG.md, creating it on first run
  • runRead — a git helper that always executes regardless of --dry-run (read-only); dry-run mode prints the would-be changelog without writing

CHANGELOG.md is staged automatically via the existing git add -A in the release commit.

Sample output:

## [0.1.0] - 2026-02-26

### ⚠️ Breaking Changes
- redesign plugin API ([ghi9012](../../commit/ghi9012))

### ✨ Features
- **markdown:** add syntax highlighting support ([abc1234](../../commit/abc1234))

### 🐛 Bug Fixes
- resolve config loading issue ([def5678](../../commit/def5678))

.github/workflows/release.yml

Triggers on tag pushes matching *-v[0-9]*.[0-9]*.[0-9]* (emitted by the release script). Extracts the matching version section from CHANGELOG.md and creates a GitHub Release with it as the release body.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add changelog workflow</issue_title>
<issue_description>We should add script to generate changelog from commits. Is it a good design to integrate it within the release process? If yes do it, if no propose one.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Priestch <2059801+Priestch@users.noreply.github.com>
Copilot AI changed the title [WIP] Add script to generate changelog from commits Add changelog generation integrated into the release process Feb 26, 2026
@Priestch

Priestch commented Mar 3, 2026

Copy link
Copy Markdown
Owner

@copilot Does the release action worked?

Copilot AI commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Does the release action worked?

Yes — it ran successfully on its first use. The workflow triggered on tag markopress-v0.0.15 pushed on 2026-03-03 and completed in ~9 seconds: https://github.com/Priestch/markopress/actions/runs/22626985091

Copilot stopped work on behalf of Priestch due to an error March 3, 2026 14:23
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.

Add changelog workflow

2 participants