fix: address verified review findings (actions-workflows-values-1)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:40:06 +02:00
1 parent 401650b489
commit 432d139071
12 files changed
+268 -34

No files matched your search

+12 -4
View File
@@ -490,16 +490,24 @@ func (a *application) completeRuns() cobra.CompletionFunc {
// completeSecrets completes Actions secret names in the selected scope.
func (a *application) completeSecrets(scope func() services.ActionScope) cobra.CompletionFunc {
return a.apiCompletion(true, func(ctx context.Context, t target, _ string) ([]cobra.Completion, error) {
items, err := services.ActionSecrets{Client: t.client, Scope: actionScope(scope, t)}.ListPage(ctx, completionLimit, 1)
return a.apiCompletion(false, func(ctx context.Context, t target, _ string) ([]cobra.Completion, error) {
selected := actionScope(scope, t)
if selected.Repository == "" && selected.Organization == "" && !selected.Account {
return nil, nil
}
items, err := services.ActionSecrets{Client: t.client, Scope: selected}.ListPage(ctx, completionLimit, 1)
return describe(items.Items, func(item services.ActionSecret) (string, string) { return item.Name, item.Description }), err
})
}
// completeVariables completes Actions variable names in the selected scope.
func (a *application) completeVariables(scope func() services.ActionScope) cobra.CompletionFunc {
return a.apiCompletion(true, func(ctx context.Context, t target, _ string) ([]cobra.Completion, error) {
items, err := services.ActionVariables{Client: t.client, Scope: actionScope(scope, t)}.ListPage(ctx, completionLimit, 1)
return a.apiCompletion(false, func(ctx context.Context, t target, _ string) ([]cobra.Completion, error) {
selected := actionScope(scope, t)
if selected.Repository == "" && selected.Organization == "" && !selected.Account {
return nil, nil
}
items, err := services.ActionVariables{Client: t.client, Scope: selected}.ListPage(ctx, completionLimit, 1)
return describe(items.Items, func(item services.ActionVariable) (string, string) { return item.Name, item.Description }), err
})
}