@@ -81,6 +81,12 @@ var CommandAdd = &cli.Command{
8181 Aliases : []string {"i" },
8282 Usage : "Provide the image(s) that can access this secret" ,
8383 },
84+ & cli.StringSliceFlag {
85+ Sources : cli .EnvVars ("VELA_REPO_ALLOWLIST" , "SECRET_REPO_ALLOWLIST" ),
86+ Name : "repo-allowlist" ,
87+ Aliases : []string {"ra" },
88+ Usage : "provide the repository allowlist for the secret" ,
89+ },
8490 & cli.StringSliceFlag {
8591 Sources : cli .EnvVars ("VELA_EVENTS" , "SECRET_EVENTS" ),
8692 Name : "event" ,
@@ -125,19 +131,21 @@ EXAMPLES:
125131 $ {{.FullName}} --secret.engine native --secret.type repo --org MyOrg --repo MyRepo --name foo --value bar --commands false
126132 3. Add an organization secret.
127133 $ {{.FullName}} --secret.engine native --secret.type org --org MyOrg --name foo --value bar
128- 4. Add a shared secret.
134+ 4. Add an organization secret and limit use to specific repositories.
135+ $ {{.FullName}} --secret.engine native --secret.type org --org MyOrg --name foo --value bar ---repo-allowlist MyOrg/repo1,MyOrg/repo2
136+ 5. Add a shared secret.
129137 $ {{.FullName}} --secret.engine native --secret.type shared --org MyOrg --team octokitties --name foo --value bar
130- 5 . Add a repository secret with all event types enabled.
138+ 6 . Add a repository secret with all event types enabled.
131139 $ {{.FullName}} --secret.engine native --secret.type repo --org MyOrg --repo MyRepo --name foo --value bar --event comment --event deployment --event pull_request --event push --event tag
132- 6 . Add a repository secret with an image whitelist.
140+ 7 . Add a repository secret with an image whitelist.
133141 $ {{.FullName}} --secret.engine native --secret.type repo --org MyOrg --repo MyRepo --name foo --value bar --image alpine --image golang:* --image postgres:latest
134- 7 . Add a secret with value from a file.
142+ 8 . Add a secret with value from a file.
135143 $ {{.FullName}} --secret.engine native --secret.type repo --org MyOrg --repo MyRepo --name foo --value @secret.txt
136- 8 . Add a repository secret with json output.
144+ 9 . Add a repository secret with json output.
137145 $ {{.FullName}} --secret.engine native --secret.type repo --org MyOrg --repo MyRepo --name foo --value bar --output json
138- 9 . Add a secret or secrets from a file.
146+ 10 . Add a secret or secrets from a file.
139147 $ {{.FullName}} --file secret.yml
140- 10 . Add a secret when config or environment variables are set.
148+ 11 . Add a secret when config or environment variables are set.
141149 $ {{.FullName}} --org MyOrg --repo MyRepo --name foo --value bar
142150
143151DOCUMENTATION:
@@ -167,19 +175,20 @@ func add(_ context.Context, c *cli.Command) error {
167175 //
168176 // https://pkg.go.dev/github.com/go-vela/cli/action/secret?tab=doc#Config
169177 s := & secret.Config {
170- Action : internal .ActionAdd ,
171- Engine : c .String (internal .FlagSecretEngine ),
172- Type : c .String (internal .FlagSecretType ),
173- Org : c .String (internal .FlagOrg ),
174- Repo : c .String (internal .FlagRepo ),
175- Team : c .String ("team" ),
176- Name : c .String ("name" ),
177- Value : c .String ("value" ),
178- Images : c .StringSlice ("image" ),
179- AllowEvents : c .StringSlice ("event" ),
180- File : c .String ("file" ),
181- Output : c .String (internal .FlagOutput ),
182- Color : output .ColorOptionsFromCLIContext (c ),
178+ Action : internal .ActionAdd ,
179+ Engine : c .String (internal .FlagSecretEngine ),
180+ Type : c .String (internal .FlagSecretType ),
181+ Org : c .String (internal .FlagOrg ),
182+ Repo : c .String (internal .FlagRepo ),
183+ Team : c .String ("team" ),
184+ Name : c .String ("name" ),
185+ Value : c .String ("value" ),
186+ Images : c .StringSlice ("image" ),
187+ RepoAllowlist : c .StringSlice ("repo-allowlist" ),
188+ AllowEvents : c .StringSlice ("event" ),
189+ File : c .String ("file" ),
190+ Output : c .String (internal .FlagOutput ),
191+ Color : output .ColorOptionsFromCLIContext (c ),
183192 }
184193
185194 // check if allow_command and allow_substitution are provided
0 commit comments