Heroku Pipelines: changing the auto-deploy branch from master to main

If you are interested in updating the name of the primary branch on your repository from master to something more inclusive (I’ll use main in my examples here), but are unsure because you deploy your app via Heroku pipelines and aren’t sure how easy that will be to change…the good news is: it’s very easy!

Before doing the below, I followed the instructions here to update both git and GitHub.

Open your pipeline in the Heroku dashboard, and for each app with automatic deploys configured, choose “Configure automatic deploys…”

You will then need to disable the automatic deploys (this will take about 1 minute to do, so while you should probably let your team know to hold off on merging changes for this time period, it will be very brief):

Once you’ve done this, you’ll be presented with a field to choose which branch to auto-deploy. You can type in the name of the branch your team has settled on (main in my case), and re-select “Enable automatic deploys”:

That’s it, you’re done! (Any currently open PRs will need to be updated to be merged into the main branch as well). 🎉