File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -622,13 +622,15 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
622
622
if err != nil {
623
623
log .Error (4 , "GetBranchCommitID[%s]: %v" , opts .RefFullName , err )
624
624
}
625
- return PrepareWebhooks (repo , HookEventCreate , & api.CreatePayload {
625
+ if err = PrepareWebhooks (repo , HookEventCreate , & api.CreatePayload {
626
626
Ref : refName ,
627
627
Sha : shaSum ,
628
628
RefType : "branch" ,
629
629
Repo : apiRepo ,
630
630
Sender : apiPusher ,
631
- })
631
+ }); err != nil {
632
+ return fmt .Errorf ("PrepareWebhooks: %v" , err )
633
+ }
632
634
}
633
635
634
636
case ActionDeleteBranch : // Delete Branch
@@ -645,14 +647,15 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
645
647
if err != nil {
646
648
log .Error (4 , "GetTagCommitID[%s]: %v" , opts .RefFullName , err )
647
649
}
648
- return PrepareWebhooks (repo , HookEventCreate , & api.CreatePayload {
650
+ if err = PrepareWebhooks (repo , HookEventCreate , & api.CreatePayload {
649
651
Ref : refName ,
650
652
Sha : shaSum ,
651
653
RefType : "tag" ,
652
654
Repo : apiRepo ,
653
655
Sender : apiPusher ,
654
- })
655
-
656
+ }); err != nil {
657
+ return fmt .Errorf ("PrepareWebhooks: %v" , err )
658
+ }
656
659
case ActionDeleteTag : // Delete Tag
657
660
isHookEventPush = true
658
661
}
Original file line number Diff line number Diff line change @@ -312,9 +312,7 @@ func TestCommitRepoAction(t *testing.T) {
312
312
s .commitRepoActionOptions .RepoName = repo .Name
313
313
314
314
s .action .ActUserID = user .ID
315
- s .action .ActUser = user
316
315
s .action .RepoID = repo .ID
317
- s .action .Repo = repo
318
316
s .action .IsPrivate = repo .IsPrivate
319
317
320
318
testCorrectRepoAction (t , s .commitRepoActionOptions , & s .action )
You can’t perform that action at this time.
0 commit comments