@@ -12,9 +12,11 @@ import (
12
12
"code.gitea.io/gitea/models/db"
13
13
git_model "code.gitea.io/gitea/models/git"
14
14
user_model "code.gitea.io/gitea/models/user"
15
+ "code.gitea.io/gitea/modules/git"
15
16
"code.gitea.io/gitea/modules/log"
16
17
api "code.gitea.io/gitea/modules/structs"
17
18
webhook_module "code.gitea.io/gitea/modules/webhook"
19
+ commitstatus_service "code.gitea.io/gitea/services/repository/commitstatus"
18
20
19
21
"github.com/nektos/act/pkg/jobparser"
20
22
)
@@ -114,19 +116,20 @@ func createCommitStatus(ctx context.Context, job *actions_model.ActionRunJob) er
114
116
}
115
117
116
118
creator := user_model .NewActionsUser ()
117
- if err := git_model .NewCommitStatus (ctx , git_model.NewCommitStatusOptions {
118
- Repo : repo ,
119
- SHA : sha ,
120
- Creator : creator ,
121
- CommitStatus : & git_model.CommitStatus {
122
- SHA : sha ,
119
+ commitID , err := git .NewIDFromString (sha )
120
+ if err != nil {
121
+ return fmt .Errorf ("HashTypeInterfaceFromHashString: %w" , err )
122
+ }
123
+ if err := commitstatus_service .CreateCommitStatus (ctx , repo , creator ,
124
+ commitID .String (),
125
+ & git_model.CommitStatus {
126
+ SHA : commitID .String (),
123
127
TargetURL : fmt .Sprintf ("%s/jobs/%d" , run .Link (), index ),
124
128
Description : description ,
125
129
Context : ctxname ,
126
130
CreatorID : creator .ID ,
127
131
State : state ,
128
- },
129
- }); err != nil {
132
+ }); err != nil {
130
133
return fmt .Errorf ("NewCommitStatus: %w" , err )
131
134
}
132
135
0 commit comments