| 264 | } |
| 265 | |
| 266 | func getBody(opts *SetOptions) (string, error) { |
| 267 | if opts.Body != "" { |
| 268 | return opts.Body, nil |
| 269 | } |
| 270 | |
| 271 | if opts.IO.CanPrompt() { |
| 272 | bodyInput, err := opts.Prompter.Input("Paste your variable", "") |
| 273 | if err != nil { |
| 274 | return "", err |
| 275 | } |
| 276 | fmt.Fprintln(opts.IO.Out) |
| 277 | return bodyInput, nil |
| 278 | } |
| 279 | |
| 280 | body, err := io.ReadAll(opts.IO.In) |
| 281 | if err != nil { |
| 282 | return "", fmt.Errorf("failed to read from standard input: %w", err) |
| 283 | } |
| 284 | |
| 285 | return string(bytes.TrimRight(body, "\r\n")), nil |
| 286 | } |
| 287 | |
| 288 | func getRepoIds(client *api.Client, host, owner string, repositoryNames []string) ([]int64, error) { |
| 289 | if len(repositoryNames) == 0 { |