@@ -61,8 +61,9 @@ func (Action) ListActionsSecrets(ctx *context.APIContext) {
6161 apiSecrets := make ([]* api.Secret , len (secrets ))
6262 for k , v := range secrets {
6363 apiSecrets [k ] = & api.Secret {
64- Name : v .Name ,
65- Created : v .CreatedUnix .AsTime (),
64+ Name : v .Name ,
65+ Description : v .Description ,
66+ Created : v .CreatedUnix .AsTime (),
6667 }
6768 }
6869
@@ -106,7 +107,8 @@ func (Action) CreateOrUpdateSecret(ctx *context.APIContext) {
106107
107108 opt := web .GetForm (ctx ).(* api.CreateOrUpdateSecretOption )
108109
109- _ , created , err := secret_service .CreateOrUpdateSecret (ctx , ctx .Org .Organization .ID , 0 , ctx .PathParam ("secretname" ), opt .Data )
110+ _ , created , err := secret_service .CreateOrUpdateSecret (
111+ ctx , ctx .Org .Organization .ID , 0 , ctx .PathParam ("secretname" ), opt .Data , opt .Description )
110112 if err != nil {
111113 if errors .Is (err , util .ErrInvalidArgument ) {
112114 ctx .Error (http .StatusBadRequest , "CreateOrUpdateSecret" , err )
@@ -230,10 +232,11 @@ func (Action) ListVariables(ctx *context.APIContext) {
230232 variables := make ([]* api.ActionVariable , len (vars ))
231233 for i , v := range vars {
232234 variables [i ] = & api.ActionVariable {
233- OwnerID : v .OwnerID ,
234- RepoID : v .RepoID ,
235- Name : v .Name ,
236- Data : v .Data ,
235+ OwnerID : v .OwnerID ,
236+ RepoID : v .RepoID ,
237+ Name : v .Name ,
238+ Data : v .Data ,
239+ Description : v .Description ,
237240 }
238241 }
239242
@@ -281,10 +284,11 @@ func (Action) GetVariable(ctx *context.APIContext) {
281284 }
282285
283286 variable := & api.ActionVariable {
284- OwnerID : v .OwnerID ,
285- RepoID : v .RepoID ,
286- Name : v .Name ,
287- Data : v .Data ,
287+ OwnerID : v .OwnerID ,
288+ RepoID : v .RepoID ,
289+ Name : v .Name ,
290+ Data : v .Data ,
291+ Description : v .Description ,
288292 }
289293
290294 ctx .JSON (http .StatusOK , variable )
@@ -386,7 +390,7 @@ func (Action) CreateVariable(ctx *context.APIContext) {
386390 return
387391 }
388392
389- if _ , err := actions_service .CreateVariable (ctx , ownerID , 0 , variableName , opt .Value ); err != nil {
393+ if _ , err := actions_service .CreateVariable (ctx , ownerID , 0 , variableName , opt .Value , opt . Description ); err != nil {
390394 if errors .Is (err , util .ErrInvalidArgument ) {
391395 ctx .Error (http .StatusBadRequest , "CreateVariable" , err )
392396 } else {
@@ -450,7 +454,7 @@ func (Action) UpdateVariable(ctx *context.APIContext) {
450454 if opt .Name == "" {
451455 opt .Name = ctx .PathParam ("variablename" )
452456 }
453- if _ , err := actions_service .UpdateVariable (ctx , v .ID , opt .Name , opt .Value ); err != nil {
457+ if _ , err := actions_service .UpdateVariable (ctx , v .ID , opt .Name , opt .Value , opt . Description ); err != nil {
454458 if errors .Is (err , util .ErrInvalidArgument ) {
455459 ctx .Error (http .StatusBadRequest , "UpdateVariable" , err )
456460 } else {
0 commit comments