sorenlouv / backport

A simple CLI tool that automates the process of backporting commits on a GitHub repo
https://github.com/sqren/backport/blob/main/docs/config-file-options.md
Apache License 2.0
241 stars 57 forks source link

`sourcePullRequest.title` contains escaped characters #490

Closed azatoth closed 4 months ago

azatoth commented 4 months ago

I have following setting in my .backportrc.json:

{
  "prTitle": "{{sourcePullRequest.title}} | backport for {{targetBranch}}"
}

If the original pull request had a title like Don't do X and Y, the backport's title now becomes Don't do X and Y |backport for myBranch.

azatoth commented 4 months ago

So this isn't actually a issue as I didn't realize first it's Handlebars, and I should just have used triple brackets instead

sorenlouv commented 4 months ago

Sorry for the slow reply. Glad you got it solved!

azatoth commented 4 months ago

Sorry for the slow reply. Glad you got it solved!

No problem; I realized I could fix my problem by using {{{sourcePullRequest.title}}} instead. Though I assume the more permanent and proper solution is to add {noEscape: true} option to Handlebars.compile()

sorenlouv commented 3 months ago

Fixed in https://github.com/sorenlouv/backport/pull/495