Automate Commit-Based GitHub Release Changelog
Uses changelogithub to read Conventional Commits between tags and create (or update) a GitHub release with a formatted changelog.
Workflow setup
Trigger and permissions
on:
push:
tags:
- 'v*'
permissions:
contents: write # required — default contents:read cannot create releases
Changelog step
Run changelogithub as the last step — after npm publish (if any) — so a failed publish doesn't create a dangling GitHub release:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # full tag history required; shallow clone produces empty changelog
- name: Generate changelog
run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Conventional Commits
changelogithub groups entries by type and surfaces breaking changes at the top:
| Commit prefix | Changelog section |
|---|---|
feat: |
Features |
fix: |
Bug Fixes |
chore: |
Chores |
feat!: / chore!: |
Breaking Changes (top) |
Commits that don't follow the convention are omitted from the changelog.
Preview before pushing a tag
npx changelogithub --dry
Reference
- For a complete end-to-end workflow combining npm publish + changelog generation, see
automate-npm-release/EXAMPLE_WORKFLOW.ymlif that skill is installed locally.