(resp *v1pb.CheckReleaseResponse)
| 28 | } |
| 29 | |
| 30 | func 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 | |
| 48 | func getPRNumberFromEventFile(eventPath string) (string, error) { |
| 49 | eventFile, err := os.ReadFile(eventPath) |
no test coverage detected