Skip to content

Commit 8427a7e

Browse files
committed
Add tagPrefix to PR title for monorepo support
When tagPrefix is configured, the PR title now includes the prefix in brackets, e.g., "[modules/vpc] Release for v1.0.1". This helps distinguish release PRs in monorepo setups.
1 parent 0aac2ba commit 8427a7e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tagpr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,7 @@ func (tp *tagpr) Run(ctx context.Context) error {
701701
NextVersion: nextVer.Tag(),
702702
Branch: rcBranch,
703703
Changelog: orig,
704+
TagPrefix: strings.TrimSuffix(tp.normalizedTagPrefix, "/"),
704705
})
705706
if err != nil {
706707
return err

template.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"text/template"
77
)
88

9-
const defaultTmplStr = `Release for {{.NextVersion}}
9+
const defaultTmplStr = `{{if .TagPrefix}}[{{.TagPrefix}}] {{end}}Release for {{.NextVersion}}
1010
1111
This pull request is for the next release as {{.NextVersion}} created by [tagpr](https://github.com/Songmu/tagpr). Merging it will tag {{.NextVersion}} to the merge commit and create a GitHub release.
1212
@@ -39,7 +39,7 @@ func init() {
3939
}
4040

4141
type tmplArg struct {
42-
NextVersion, Branch, Changelog string
42+
NextVersion, Branch, Changelog, TagPrefix string
4343
}
4444

4545
func newPRTmpl(tmpl *template.Template) *prTmpl {

0 commit comments

Comments
 (0)