Turn Heroku deploys into a readable Slack changelog
Every time you ship to Heroku, we post a clear summary to Slack listing what changed, who deployed it, and whether it was a rollback.
Whenever a new release is deployed to my Heroku app, publish a readable deploy announcement to my Slack channel. Trigger this by polling Heroku for a new release (a deploy) on the app I specify. I will tell you which Heroku app to watch and which GitHub repository holds that app's code.
When a new release fires, use Heroku's Get Release to pull the details of the new version: the version number, the description, who deployed it (the deployer), and the timestamp it went live. Also determine the timestamp of the previous release for this app so you know the window of changes to summarize.
Use GitHub's List Pull Requests on the mapped repository to gather the pull requests that were merged since the previous release. Filter to closed pull requests and keep only the ones that were actually merged and whose merge time is after the prior release's timestamp. Ignore pull requests that were closed without merging, and ignore anything merged before the last deploy.
From those merged pull requests, draft a plain-English "What shipped in vN" changelog using the new version number. Summarize what actually changed in clear language, group related changes where it helps readability, and keep it skimmable. Lead with the version number, name the person who deployed, and note the time it went live.
Check the release description before writing. If it reads "Rollback to vX", clearly flag the announcement as a rollback to that earlier version instead of listing new changes, and say who performed the rollback. If there are no merged pull requests since the previous release, still post a short note confirming the deploy rather than an empty changelog.
Post the finished summary to my Slack channel using Slack's Send a Message. Format it with Slack's message formatting (single asterisks for bold, and <url|text> for links) so it reads cleanly in the channel.
Additional information
What does this prompt do?
- Watches your Heroku app and runs the moment a new version is deployed.
- Gathers the pull requests that shipped since your last deploy and turns them into a plain-English "What shipped in vN" summary.
- Posts the summary to your chosen Slack channel, including the version number, who deployed, and when it went live.
- Automatically flags rollbacks so the team knows when a release is reverting to an earlier version.
What do I need to use this?
- A Heroku account with the app you want to watch.
- A GitHub account connected to the repository that holds that app's code.
- A Slack workspace and the channel where announcements should be posted.
How can I customize it?
- Choose which Slack channel receives the deploy announcements.
- Map each Heroku app to the GitHub repository that powers it.
- Adjust the tone and length of the changelog, or group changes into features, fixes, and chores.
Frequently asked questions
Which Heroku apps does this work with?
How does it know what changed?
What happens when a deploy is a rollback?
Will the announcement say who deployed?
Do I have to write the update myself?
Related templates
Stop writing deploy updates by hand.
Let every Heroku release announce itself in Slack, complete with a readable changelog of what shipped.