Question: Can Knope Bot's commit message and/or PR title be customized?
When using knope release, the configuration option title.template allows customization of the pr title for the release step.
However, I couldn’t find any settings related to customizing the commit message or pr title created by the gh bot. Are these currently configurable? If not, would you consider supporting this as a feature request?
They aren't configurable yet, but they absolutely should be. I'm also trying to figure out how to make release notes more customizable, since folks have asked to be able to add commit hashes.
Ideas welcome!
Are you just looking for a different static message, or would you want some dynamic info included?
Sorry for the late response. I'm just looking for a different static message currently, but dynamic ones would be cool!
Well static is super easy to start with! I just deployed a change that lets you do this in your knope.toml:
[bot.releases]
enabled = true
pull_request.title = "Whatever you want here"
That will set both the title of the pull request and the commit message that Knope uses on its knope/release branch. Give it a try and let me know how that works for you before I document it 😁.
I think we can also add the dynamic $version without too much trouble, just need to figure out what happens if you use that but there are multiple package versions (for monorepos). Can't exactly just error in the bot like we do in the CLI 🤔.
Thank you for your great work! I think the addition of $version would be great for my use case (only one package) if possible.
Alright, version should now be enabled in two flavors:
- You can still just set a string and now include the default
$versionvariable where you'd like:pull_request.title = "Time to release $version!" - You can use the same template syntax as
CreatePullRequest:
[bot.releases]
enabled = true
[bot.releases.pull_request.title]
template = "I need to preserve $version and instead replace {version}"
variables = {"{version}" = "Version"}
I kinda doubt the latter is really needed right now, but I figure I should keep it around for consistency 😁
Thank you again for the amazing support, just updated my config to use the new option!