Features
Knope Bot is a GitHub App that performs common Knope tasks automatically without complex GitHub Actions workflows. You can install the bot from GitHub Marketplace. Only install it for the repositories you want to enforce documentation on (as it will do this by default).
Enforcing documentation
The bot keeps an up-to-date check on all non-draft pull requests to verify that they’re documented, with at least one change file or conventional commit.
Double-checking documentation
When a check from Knope Bot passes or fails, the details will include an explanation of why, so that you can double-check Knope’s work.
Change files
If a pull request has at least one change file, it will pass the check:
Conventional commits
There are three ways to merge a pull request: merge commits, rebasing, and squashing. Every method which is enabled for a repository must result in at least one conventional commit for the pull request to be considered documented via conventional commits. In the details of the check, you will see an bullet point for each merge method explaining why that method passed or failed (independent of the others).
Pull request title
In two circumstances, the title of the pull request will become a commit message—in these cases, a check can pass by checking only the pull request title:
- Squash merging when either there is more than one commit in the pull request or the repository is configured to always use the pull request title as the commit title. By default, if there is only one commit, GitHub will use that commit when squash merging (effectively rebasing).
- Merge commits when the repository is configured to use the pull request title as the commit title. By default, GitHub uses a generic merge commit message, not the pull request title.
Commit messages
For all the merge methods enabled on the repository and not covered by the pull request title, the bot will check the commit messages included in the pull request. If Knope Bot can parse any of the commits in the pull request as a conventional commit (even if they wouldn’t change the next version or changelog), the check will pass.
Creating change files
When a check fails, the details of that check will contain instructions for creating a changeset:
For pull requests that aren’t from forks, project members will see buttons to create change files directly for the three main change types. Clicking one of those buttons will cause the bot to commit the change file directly to the pull request branch.
For anyone who can’t see those buttons (or anyone who wants more control over the change documentation), there is a link to using Knope’s CLI. There’s also an example Markdown snippet that contributors can copy into a change file manually.