| 411 | } |
| 412 | |
| 413 | func getBody(opts *SetOptions) ([]byte, error) { |
| 414 | if opts.Body != "" { |
| 415 | return []byte(opts.Body), nil |
| 416 | } |
| 417 | |
| 418 | if opts.IO.CanPrompt() { |
| 419 | bodyInput, err := opts.Prompter.Password("Paste your secret:") |
| 420 | if err != nil { |
| 421 | return nil, err |
| 422 | } |
| 423 | fmt.Fprintln(opts.IO.Out) |
| 424 | return []byte(bodyInput), nil |
| 425 | } |
| 426 | |
| 427 | body, err := io.ReadAll(opts.IO.In) |
| 428 | if err != nil { |
| 429 | return nil, fmt.Errorf("failed to read from standard input: %w", err) |
| 430 | } |
| 431 | |
| 432 | return bytes.TrimRight(body, "\r\n"), nil |
| 433 | } |
| 434 | |
| 435 | func mapRepoNamesToIDs(client *api.Client, host, defaultOwner string, repositoryNames []string) ([]int64, error) { |
| 436 | repos := make([]ghrepo.Interface, 0, len(repositoryNames)) |