Skip to content

Commit 93ed7a0

Browse files
committed
Make Draft working as a WIP prefix
The issue was that only the actual title was converted to uppercase, but not the prefix as specified in `WORK_IN_PROGRESS_PREFIXES`. As a result, the following did not work: WORK_IN_PROGRESS_PREFIXES=Draft:,[Draft],WIP:,[WIP] One possible workaround was: WORK_IN_PROGRESS_PREFIXES=DRAFT:,[DRAFT],WIP:,[WIP] Then indeed one could use `Draft` (as well as `DRAFT`) in the title. However, the link `Start the title with DRAFT: to prevent the pull request from being merged accidentally.` showed the suggestion in uppercase; so it is not possible to show it as `Draft`. This PR fixes it, and allows to use `Draft` in `WORK_IN_PROGRESS_PREFIXES`. Fixes go-gitea#19779.
1 parent a9af93c commit 93ed7a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/pull.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ func (pr *PullRequest) IsWorkInProgress() bool {
588588
// HasWorkInProgressPrefix determines if the given PR title has a Work In Progress prefix
589589
func HasWorkInProgressPrefix(title string) bool {
590590
for _, prefix := range setting.Repository.PullRequest.WorkInProgressPrefixes {
591-
if strings.HasPrefix(strings.ToUpper(title), prefix) {
591+
if strings.HasPrefix(strings.ToUpper(title), strings.ToUpper(prefix)) {
592592
return true
593593
}
594594
}

0 commit comments

Comments
 (0)