11//
2- // Copyright 2023 The Chainloop Authors.
2+ // Copyright 2024 The Chainloop Authors.
33//
44// Licensed under the Apache License, Version 2.0 (the "License");
55// you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ import (
2323)
2424
2525func newWorkflowContractUpdateCmd () * cobra.Command {
26- var contractID , name , contractPath string
26+ var contractID , name , description , contractPath string
2727
2828 cmd := & cobra.Command {
2929 Use : "update" ,
@@ -35,7 +35,12 @@ func newWorkflowContractUpdateCmd() *cobra.Command {
3535 return nil
3636 },
3737 RunE : func (cmd * cobra.Command , args []string ) error {
38- res , err := action .NewWorkflowContractUpdate (actionOpts ).Run (contractID , name , contractPath )
38+ var desc * string
39+ if cmd .Flags ().Changed ("description" ) {
40+ desc = & description
41+ }
42+
43+ res , err := action .NewWorkflowContractUpdate (actionOpts ).Run (contractID , name , desc , contractPath )
3944 if err != nil {
4045 return err
4146 }
@@ -51,6 +56,7 @@ func newWorkflowContractUpdateCmd() *cobra.Command {
5156
5257 cmd .Flags ().StringVarP (& contractPath , "contract" , "f" , "" , "path or URL to the contract schema" )
5358 cmd .Flags ().StringVar (& name , "name" , "" , "name of the contract" )
59+ cmd .Flags ().StringVar (& description , "description" , "" , "description of the contract" )
5460
5561 return cmd
5662}
0 commit comments