Support migrating GitHub/GitLab PR draft status (#32242)

Resolve #32196
This commit is contained in:
Zettat123 2024-10-14 03:58:13 +08:00 committed by GitHub
parent 9df5ddaf44
commit 74664b08a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 1 deletions

View file

@ -760,10 +760,15 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*issues_model
pr.Updated = pr.Created
}
prTitle := pr.Title
if pr.IsDraft && !issues_model.HasWorkInProgressPrefix(pr.Title) {
prTitle = fmt.Sprintf("%s %s", setting.Repository.PullRequest.WorkInProgressPrefixes[0], pr.Title)
}
issue := issues_model.Issue{
RepoID: g.repo.ID,
Repo: g.repo,
Title: pr.Title,
Title: prTitle,
Index: pr.Number,
Content: pr.Content,
MilestoneID: milestoneID,