mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	label and milestone webhooks on issue/pull creation (#14363)
This commit is contained in:
		| @@ -29,6 +29,12 @@ func NewIssue(repo *models.Repository, issue *models.Issue, labelIDs []int64, uu | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	notification.NotifyNewIssue(issue, mentions) | 	notification.NotifyNewIssue(issue, mentions) | ||||||
|  | 	if len(issue.Labels) > 0 { | ||||||
|  | 		notification.NotifyIssueChangeLabels(issue.Poster, issue, issue.Labels, nil) | ||||||
|  | 	} | ||||||
|  | 	if issue.Milestone != nil { | ||||||
|  | 		notification.NotifyIssueChangeMilestone(issue.Poster, issue, 0) | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|   | |||||||
| @@ -59,6 +59,12 @@ func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int6 | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	notification.NotifyNewPullRequest(pr, mentions) | 	notification.NotifyNewPullRequest(pr, mentions) | ||||||
|  | 	if len(pull.Labels) > 0 { | ||||||
|  | 		notification.NotifyIssueChangeLabels(pull.Poster, pull, pull.Labels, nil) | ||||||
|  | 	} | ||||||
|  | 	if pull.Milestone != nil { | ||||||
|  | 		notification.NotifyIssueChangeMilestone(pull.Poster, pull, 0) | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	// add first push codes comment | 	// add first push codes comment | ||||||
| 	baseGitRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath()) | 	baseGitRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath()) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user