Skip to content

Commit

Permalink
Add ReviewedOnTrailer/ReviewedByTrailer to merge message template vars
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxWipfli committed Jun 1, 2024
1 parent a5207d2 commit d2cba47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/content/usage/merge-message-templates.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ You can use the following variables enclosed in `${}` inside these templates whi
- PullRequestIndex: Pull request's index number
- PullRequestReference: Pull request's reference char with index number. i.e. #1, !2
- ClosingIssues: return a string contains all issues which will be closed by this pull request i.e. `close #1, close #2`
- ReviewedOnTrailer: Message trailer including pull request URL, i.e. `Reviewed-on: https://gitea.com/foo/bar/pulls/1`
- ReviewedByTrailer: Message trailer including pull request approvers, i.e.,`Reviewed-by: Jane Doe <[email protected]>`

## Rebase

Expand Down
2 changes: 2 additions & 0 deletions services/pull/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func getMergeMessage(ctx context.Context, baseGitRepo *git.Repository, pr *issue
"PullRequestPosterName": pr.Issue.Poster.Name,
"PullRequestIndex": strconv.FormatInt(pr.Index, 10),
"PullRequestReference": fmt.Sprintf("%s%d", issueReference, pr.Index),
"ReviewedOnTrailer": reviewedOnTrailer,
"ReviewedByTrailer": reviewedByTrailer,
}
if pr.HeadRepo != nil {
vars["HeadRepoOwnerName"] = pr.HeadRepo.OwnerName
Expand Down

0 comments on commit d2cba47

Please sign in to comment.