PRBodyFromPRD generates a PR body with a summary and list of completed stories.
(p *prd.PRD)
| 58 | |
| 59 | // PRBodyFromPRD generates a PR body with a summary and list of completed stories. |
| 60 | func PRBodyFromPRD(p *prd.PRD) string { |
| 61 | var b strings.Builder |
| 62 | |
| 63 | b.WriteString("## Summary\n\n") |
| 64 | b.WriteString(p.Description) |
| 65 | b.WriteString("\n\n") |
| 66 | |
| 67 | b.WriteString("## Changes\n\n") |
| 68 | for _, story := range p.UserStories { |
| 69 | if story.Passes { |
| 70 | b.WriteString(fmt.Sprintf("- %s: %s\n", story.ID, story.Title)) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | return b.String() |
| 75 | } |
| 76 | |
| 77 | // DeleteBranch deletes a local branch. |
| 78 | func DeleteBranch(repoDir, branch string) error { |