@@ -35,6 +35,12 @@ func GetRegistrationToken(ctx *context.APIContext, ownerID, repoID int64) {
35
35
ctx .JSON (http .StatusOK , RegistrationToken {Token : token .Token })
36
36
}
37
37
38
+ // List Runners for api route validated ownerID and repoID
39
+ // ownerID == 0 and repoID == 0 means all runners including global runners, does not appear in sql where clause
40
+ // ownerID == 0 and repoID != 0 means all runners for the given repo
41
+ // ownerID != 0 and repoID == 0 means all runners for the given user/org
42
+ // ownerID != 0 and repoID != 0 undefined behavior
43
+ // Access rights are checked at the API route level
38
44
func ListRunners (ctx * context.APIContext , ownerID , repoID int64 ) {
39
45
runners , total , err := db .FindAndCount [actions_model.ActionRunner ](ctx , & actions_model.FindRunnerOptions {
40
46
OwnerID : ownerID ,
@@ -57,6 +63,12 @@ func ListRunners(ctx *context.APIContext, ownerID, repoID int64) {
57
63
ctx .JSON (http .StatusOK , & res )
58
64
}
59
65
66
+ // Get Runners for api route validated ownerID and repoID
67
+ // ownerID == 0 and repoID == 0 means any runner including global runners
68
+ // ownerID == 0 and repoID != 0 means any runner for the given repo
69
+ // ownerID != 0 and repoID == 0 means any runner for the given user/org
70
+ // ownerID != 0 and repoID != 0 undefined behavior
71
+ // Access rights are checked at the API route level
60
72
func GetRunner (ctx * context.APIContext , ownerID , repoID , runnerID int64 ) {
61
73
runner , err := actions_model .GetRunnerByID (ctx , runnerID )
62
74
if err != nil {
@@ -70,6 +82,12 @@ func GetRunner(ctx *context.APIContext, ownerID, repoID, runnerID int64) {
70
82
ctx .JSON (http .StatusOK , convert .ToActionRunner (ctx , runner ))
71
83
}
72
84
85
+ // Delete Runner for api route validated ownerID and repoID
86
+ // ownerID == 0 and repoID == 0 means any runner including global runners
87
+ // ownerID == 0 and repoID != 0 means any runner for the given repo
88
+ // ownerID != 0 and repoID == 0 means any runner for the given user/org
89
+ // ownerID != 0 and repoID != 0 undefined behavior
90
+ // Access rights are checked at the API route level
73
91
func DeleteRunner (ctx * context.APIContext , ownerID , repoID , runnerID int64 ) {
74
92
runner , err := actions_model .GetRunnerByID (ctx , runnerID )
75
93
if err != nil {
0 commit comments