How to Create a GitHub Release With a Changelog in GitHub Actions
On a tag push, create a Release and let GitHub generate the changelog from merged PRs, attaching your built assets.
Use softprops/action-gh-release (or gh release create) with generate_release_notes: true to build the changelog automatically. Grant contents: write and trigger on tag pushes.
Steps
- Trigger on
pushwith atags: ["v*"]filter. - Grant
permissions: contents: write. - Build the release artifacts.
- Create the release with
generate_release_notes: trueandfiles:.
Workflow
.github/workflows/release.yml
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build && npm pack
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: '*.tgz'Common pitfalls
- Without
contents: writethe release API call returns 403 "Resource not accessible by integration". - Auto-generated notes need a previous tag to diff against; the first release lists everything.
- A shallow checkout can miss tags; set
fetch-depth: 0if your notes logic walks history.
Related guides
How to Deploy to GitHub Pages With GitHub ActionsDeploy a static site to GitHub Pages with the official Actions flow: upload-pages-artifact then deploy-pages,…
How to Publish an npm Package With Provenance in GitHub ActionsPublish an npm package with build provenance from GitHub Actions by setting id-token write and running npm pu…