1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-28 03:28:13 +00:00
This commit is contained in:
Lunny Xiao
2022-10-16 23:23:47 +08:00
committed by Jason Song
parent 482832da76
commit f75a4abc5d
6 changed files with 26 additions and 17 deletions

View File

@@ -23,7 +23,7 @@ import (
// Run represents a run of a workflow file
type Run struct {
ID int64
Name string
Title string
RepoID int64 `xorm:"index unique(repo_workflow_index)"`
Repo *repo_model.Repository `xorm:"-"`
WorkflowID string `xorm:"index unique(repo_workflow_index)"` // the name of workflow file
@@ -52,6 +52,10 @@ func (Run) TableName() string {
return "bots_run"
}
func (run *Run) HTMLURL() string {
return fmt.Sprintf("%s/builds/run/%d", run.Repo.HTMLURL(), run.Index)
}
// LoadAttributes load Repo TriggerUser if not loaded
func (r *Run) LoadAttributes(ctx context.Context) error {
if r == nil {