@@ -53,7 +53,7 @@ func (s *Service) executeRepositoryWebHook(t *sdk.TaskExecution) ([]sdk.Workflow
53
53
}
54
54
if pushEvent .Deleted {
55
55
branch := strings .TrimPrefix (pushEvent .Ref , "refs/heads/" )
56
- err := s .enqueueBranchDeletion (t . UUID , projectKey , workflowName , branch )
56
+ err := s .enqueueBranchDeletion (projectKey , workflowName , branch )
57
57
58
58
return nil , sdk .WrapError (err , "cannot enqueue branch deletion" )
59
59
}
@@ -99,7 +99,7 @@ func (s *Service) executeRepositoryWebHook(t *sdk.TaskExecution) ([]sdk.Workflow
99
99
}
100
100
// Branch deletion ( gitlab return 0000000000000000000000000000000000000000 as git hash)
101
101
if pushEvent .After == "0000000000000000000000000000000000000000" {
102
- err := s .enqueueBranchDeletion (t . UUID , projectKey , workflowName , strings .TrimPrefix (pushEvent .Ref , "refs/heads/" ))
102
+ err := s .enqueueBranchDeletion (projectKey , workflowName , strings .TrimPrefix (pushEvent .Ref , "refs/heads/" ))
103
103
return nil , sdk .WrapError (err , "cannot enqueue branch deletion" )
104
104
}
105
105
payload ["git.author" ] = pushEvent .UserUsername
@@ -142,7 +142,7 @@ func (s *Service) executeRepositoryWebHook(t *sdk.TaskExecution) ([]sdk.Workflow
142
142
143
143
for _ , pushChange := range pushEvent .Changes {
144
144
if pushChange .Type == "DELETE" {
145
- err := s .enqueueBranchDeletion (t . UUID , projectKey , workflowName , strings .TrimPrefix (pushChange .RefID , "refs/heads/" ))
145
+ err := s .enqueueBranchDeletion (projectKey , workflowName , strings .TrimPrefix (pushChange .RefID , "refs/heads/" ))
146
146
if err != nil {
147
147
log .Error ("cannot enqueue branch deletion: %v" , err )
148
148
}
@@ -292,7 +292,7 @@ func executeWebHook(t *sdk.TaskExecution) (*sdk.WorkflowNodeRunHookEvent, error)
292
292
return & h , nil
293
293
}
294
294
295
- func (s * Service ) enqueueBranchDeletion (uuid , projectKey , workflowName , branch string ) error {
295
+ func (s * Service ) enqueueBranchDeletion (projectKey , workflowName , branch string ) error {
296
296
config := sdk.WorkflowNodeHookConfig {
297
297
"project" : sdk.WorkflowNodeHookConfigValue {
298
298
Configurable : false ,
@@ -313,7 +313,7 @@ func (s *Service) enqueueBranchDeletion(uuid, projectKey, workflowName, branch s
313
313
task := sdk.Task {
314
314
Config : config ,
315
315
Type : TypeBranchDeletion ,
316
- UUID : uuid ,
316
+ UUID : sdk . UUID () ,
317
317
}
318
318
319
319
_ , err := s .startTask (context .Background (), & task )
0 commit comments