mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: address verified review findings (actions-workflows-values-1)
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
12 files changed
+268
-34
No files matched your search
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user