Skip to content

changesets/bot

Repository files navigation

changeset-bot

A GitHub App built with Probot to detect changesets in PRs

This bot will comment on PRs saying that either a user might need to add a changeset(note that PRs changing things like documentation generally don't need a changeset)or say that the PR is good and already has a changeset.

screenshot of changeset bot message from https://github.com/mitchellhamilton/manypkg/pull/18 before a changeset was added

screenshot of the changeset bot message from https://github.com/mitchellhamilton/manypkg/pull/18 showing the changeset good to go message

Sometimes, a contributor won't add a changeset to a PR but you might want to merge in the PR without having to wait on them to add it. To address this, this bot adds a link with the filename pre-filled to add a changeset so all you have to do is write the changeset and click commit.

screenshot of the changeset bot message from https://github.com/mitchellhamilton/manypkg/pull/18 focused on the create a changeset link

screenshot of creating a changeset directly on GitHub

screenshot of the GitHub file creation page focusing on the commit button

screenshot of the changeset bot message from https://github.com/mitchellhamilton/manypkg/pull/18 showing the changeset good to go message

When writing the changeset, it should look something like this with the packages that are being released in the YAML front matter with associated semver bump types and the summary of the changes in markdown.

---
'@changesets/cli': major
'@changesets/read': minor
---

A very helpful description of the changes

The information below is for contributing to the bot.

Setup

yarn

Behaviour

The changeset bot will listen for pull requests being opened and pull requests that have been updated, upon which it will then scan through the files for a changeset that has been added. The bot will make a comment on the PR stating whether it found a changeset or not, as well as the message of the latest commit. If the PR is being updated then the bot will update the existing comment