mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Fix workflow trigger event IssueChangeXXX bug (#29559)
Bugs from #29308 Follow #29467 partly fix #29558
This commit is contained in:
		@@ -171,14 +171,26 @@ func (n *actionsNotifier) IssueChangeMilestone(ctx context.Context, doer *user_m
 | 
				
			|||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		action = api.HookIssueDemilestoned
 | 
							action = api.HookIssueDemilestoned
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestMilestone, action)
 | 
					
 | 
				
			||||||
 | 
						hookEvent := webhook_module.HookEventIssueMilestone
 | 
				
			||||||
 | 
						if issue.IsPull {
 | 
				
			||||||
 | 
							hookEvent = webhook_module.HookEventPullRequestMilestone
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						notifyIssueChange(ctx, doer, issue, hookEvent, action)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (n *actionsNotifier) IssueChangeLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue,
 | 
					func (n *actionsNotifier) IssueChangeLabels(ctx context.Context, doer *user_model.User, issue *issues_model.Issue,
 | 
				
			||||||
	_, _ []*issues_model.Label,
 | 
						_, _ []*issues_model.Label,
 | 
				
			||||||
) {
 | 
					) {
 | 
				
			||||||
	ctx = withMethod(ctx, "IssueChangeLabels")
 | 
						ctx = withMethod(ctx, "IssueChangeLabels")
 | 
				
			||||||
	notifyIssueChange(ctx, doer, issue, webhook_module.HookEventPullRequestLabel, api.HookIssueLabelUpdated)
 | 
					
 | 
				
			||||||
 | 
						hookEvent := webhook_module.HookEventIssueLabel
 | 
				
			||||||
 | 
						if issue.IsPull {
 | 
				
			||||||
 | 
							hookEvent = webhook_module.HookEventPullRequestLabel
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						notifyIssueChange(ctx, doer, issue, hookEvent, api.HookIssueLabelUpdated)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func notifyIssueChange(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, event webhook_module.HookEventType, action api.HookIssueAction) {
 | 
					func notifyIssueChange(ctx context.Context, doer *user_model.User, issue *issues_model.Issue, event webhook_module.HookEventType, action api.HookIssueAction) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user