@@ -29,6 +29,7 @@ func newAttestationInitCmd() *cobra.Command {
2929 contractRevision int
3030 attestationDryRun bool
3131 workflowName string
32+ projectName string
3233 )
3334
3435 cmd := & cobra.Command {
@@ -37,14 +38,14 @@ func newAttestationInitCmd() *cobra.Command {
3738 Annotations : map [string ]string {
3839 useAPIToken : "true" ,
3940 },
40- PreRunE : func (cmd * cobra.Command , args []string ) error {
41+ PreRunE : func (_ * cobra.Command , _ []string ) error {
4142 if workflowName == "" {
42- return errors .New ("workflow name is required, set it via --name flag" )
43+ return errors .New ("workflow name is required, set it via --workflow flag" )
4344 }
4445
4546 return nil
4647 },
47- RunE : func (cmd * cobra.Command , args []string ) error {
48+ RunE : func (cmd * cobra.Command , _ []string ) error {
4849 a , err := action .NewAttestationInit (
4950 & action.AttestationInitOpts {
5051 ActionsOpts : actionOpts ,
@@ -58,7 +59,7 @@ func newAttestationInitCmd() *cobra.Command {
5859 }
5960
6061 // Initialize it
61- attestationID , err := a .Run (cmd .Context (), contractRevision , workflowName )
62+ attestationID , err := a .Run (cmd .Context (), contractRevision , projectName , workflowName )
6263 if err != nil {
6364 if errors .Is (err , action .ErrAttestationAlreadyExist ) {
6465 return err
@@ -86,7 +87,11 @@ func newAttestationInitCmd() *cobra.Command {
8687 logger .Info ().Msg ("The attestation is being crafted in dry-run mode. It will not get stored once rendered" )
8788 }
8889
89- return encodeOutput (res , simpleStatusTable )
90+ if projectName == "" {
91+ logger .Warn ().Msg ("DEPRECATION WARNING: --project not set, this will be required in the near future" )
92+ }
93+
94+ return encodeOutput (res , fullStatusTable )
9095 },
9196 }
9297
@@ -96,10 +101,10 @@ func newAttestationInitCmd() *cobra.Command {
96101 cmd .Flags ().IntVar (& contractRevision , "contract-revision" , 0 , "revision of the contract to retrieve, \" latest\" by default" )
97102 cmd .Flags ().BoolVar (& useAttestationRemoteState , "remote-state" , false , "Store the attestation state remotely" )
98103
99- // workflow-name has been replaced by --name flag
100- cmd .Flags ().StringVar (& workflowName , "workflow-name" , "" , "name of the workflow to run the attestation" )
101- cobra .CheckErr (cmd .Flags ().MarkHidden ("workflow-name" ))
104+ // name has been replaced by --workflow flag
105+ cmd .Flags ().StringVar (& workflowName , "workflow" , "" , "name of the workflow to run the attestation" )
102106 cmd .Flags ().StringVar (& workflowName , "name" , "" , "name of the workflow to run the attestation" )
103-
107+ cobra .CheckErr (cmd .Flags ().MarkDeprecated ("name" , "please use --workflow instead" ))
108+ cmd .Flags ().StringVar (& projectName , "project" , "" , "name of the project of this workflow" )
104109 return cmd
105110}
0 commit comments