MCPcopy Index your code
hub / github.com/bytebase/bytebase / CreateCommentAndAnnotation

Function CreateCommentAndAnnotation

action/github/github.go:30–46  ·  view source on GitHub ↗
(resp *v1pb.CheckReleaseResponse)

Source from the content-addressed store, hash-verified

28}
29
30func CreateCommentAndAnnotation(resp *v1pb.CheckReleaseResponse) error {
31 // Write annotations to the pull request.
32 if err := writeAnnotations(resp); err != nil {
33 return err
34 }
35
36 ghe, err := env.ParseAs[githubEnv]()
37 if err != nil {
38 return errors.Wrap(err, "failed to parse GitHub environment variables")
39 }
40 // Upsert a comment on the pull request with the check results.
41 if err := upsertComment(resp, &ghe); err != nil {
42 fmt.Printf("failed to upsert comment on the pull request: %v\n", err)
43 return nil
44 }
45 return nil
46}
47
48func getPRNumberFromEventFile(eventPath string) (string, error) {
49 eventFile, err := os.ReadFile(eventPath)

Callers 1

runCheckFunction · 0.92

Calls 2

writeAnnotationsFunction · 0.85
upsertCommentFunction · 0.85

Tested by

no test coverage detected