MCPcopy Create free account
hub / github.com/bytebase/bytebase / writeGitHubStepSummary

Function writeGitHubStepSummary

action/command/output/output.go:82–99  ·  view source on GitHub ↗

writeGitHubStepSummary writes the GitHub step summary for rollout operations.

(w *world.World)

Source from the content-addressed store, hash-verified

80
81// writeGitHubStepSummary writes the GitHub step summary for rollout operations.
82func writeGitHubStepSummary(w *world.World) error {
83 if w.Platform != world.GitHub || !w.IsRollout {
84 return nil
85 }
86
87 filename := os.Getenv("GITHUB_STEP_SUMMARY")
88 f, err := os.OpenFile(filename, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
89 if err != nil {
90 return errors.Wrapf(err, "failed to open GitHub step summary file: %s", filename)
91 }
92 defer f.Close()
93
94 summary := github.BuildSummaryMarkdown(w)
95 if _, err := f.WriteString(summary); err != nil {
96 return errors.Wrapf(err, "failed to write GitHub step summary: %s", filename)
97 }
98 return nil
99}

Callers 1

WriteOutputFunction · 0.85

Calls 2

BuildSummaryMarkdownFunction · 0.92
CloseMethod · 0.65

Tested by

no test coverage detected