MCPcopy Create free account
hub / github.com/coder/coder / TriggerWorkflow

Method TriggerWorkflow

scripts/releaser/executor.go:47–66  ·  view source on GitHub ↗
(_ context.Context, ref, channel, releaseNotes string)

Source from the content-addressed store, hash-verified

45}
46
47func (*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.
69type dryRunExecutor struct {

Callers

nothing calls this directly

Calls 4

CommandMethod · 0.80
RunMethod · 0.65
MarshalMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected