1
1
mirror of https://github.com/go-gitea/gitea synced 2025-10-28 09:58:25 +00:00

Add commit status for push event

This commit is contained in:
Lunny Xiao
2022-10-24 22:59:55 +08:00
committed by Jason Song
parent 0bc995889f
commit 82c6fc2217
5 changed files with 106 additions and 24 deletions

View File

@@ -43,12 +43,7 @@ func (RunJob) TableName() string {
return "bots_run_job"
}
// LoadAttributes load Run if not loaded
func (job *RunJob) LoadAttributes(ctx context.Context) error {
if job == nil {
return nil
}
func (job *RunJob) LoadRun(ctx context.Context) error {
if job.Run == nil {
run, err := GetRunByID(ctx, job.RunID)
if err != nil {
@@ -56,6 +51,18 @@ func (job *RunJob) LoadAttributes(ctx context.Context) error {
}
job.Run = run
}
return nil
}
// LoadAttributes load Run if not loaded
func (job *RunJob) LoadAttributes(ctx context.Context) error {
if job == nil {
return nil
}
if err := job.LoadRun(ctx);err != nil {
return err
}
return job.Run.LoadAttributes(ctx)
}