| 45 | } |
| 46 | |
| 47 | func (*liveExecutor) TriggerWorkflow(_ context.Context, ref, channel, releaseNotes string) error { |
| 48 | payload := map[string]string{ |
| 49 | "dry_run": "false", |
| 50 | "release_channel": channel, |
| 51 | "release_notes": releaseNotes, |
| 52 | } |
| 53 | payloadJSON, err := json.Marshal(payload) |
| 54 | if err != nil { |
| 55 | return xerrors.Errorf("marshaling workflow payload: %w", err) |
| 56 | } |
| 57 | cmd := exec.Command("gh", "workflow", "run", "release.yaml", |
| 58 | "--repo", owner+"/"+repo, |
| 59 | "--ref", ref, |
| 60 | "--json", |
| 61 | ) |
| 62 | cmd.Stdin = strings.NewReader(string(payloadJSON)) |
| 63 | cmd.Stdout = os.Stdout |
| 64 | cmd.Stderr = os.Stderr |
| 65 | return cmd.Run() |
| 66 | } |
| 67 | |
| 68 | // dryRunExecutor prints what would happen without doing it. |
| 69 | type dryRunExecutor struct { |