@@ -25,12 +25,17 @@ type RequireAction struct {
25
25
OrgID int64 `xorm:"index"`
26
26
RepoID int64 `xorm:"index"`
27
27
Name string `xorm:"UNIQUE(owner_repo_name) NOT NULL"`
28
- Data string `xorm:"LONGTEXT NOT NULL"`
28
+ Description string `xorm:"LONGTEXT NOT NULL"`
29
29
CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL"`
30
30
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
31
31
RepoRange string // glob match which repositories could use this runner
32
32
}
33
33
34
+ type GlobalWorkflow struct {
35
+ RepoName string
36
+ Filename string
37
+ }
38
+
34
39
func init () {
35
40
db .RegisterModel (new (RequireAction ))
36
41
}
@@ -58,33 +63,3 @@ func (r *RequireAction) LoadAttributes(ctx context.Context) error {
58
63
return nil
59
64
}
60
65
61
- func ListAvailableWorkflows (ctx context.Context , orgID int64 ) ([]* RequireAction , error ) {
62
- requireActionList := []* RequireAction {}
63
- /*
64
- orgRepos, err := org_model.GetOrgRepositories(ctx, orgID)
65
- if err != nil {
66
- return nil, fmt.Errorf("ListAvailableWorkflows get org repos: %w", err)
67
- }
68
- for _, repo := range orgRepos {
69
- repo.LoadUnits(ctx)
70
- actionsConfig := repo.MustGetUnit(ctx, unit.TypeActions).ActionsConfig()
71
- enabledWorkflows := actionsConfig.GetGlobalWorkflow()
72
- for _, workflow := range enabledWorkflows {
73
- requireAction := &RequireAction{
74
- OrgID: orgID,
75
- RepoID: repo.ID,
76
- Repo: repo,
77
- Data: workflow,
78
- Link: repo.APIURL(),
79
- }
80
- requireActionList = append(requireActionList, requireAction)
81
- }
82
- }
83
- for _, require_action := range requireActionList {
84
- if err := require_action.Validate(); err != nil {
85
- return requireActionList, err
86
- }
87
- }
88
- */
89
- return requireActionList , nil
90
- }
0 commit comments