removeMainlineBlurb removes the mainline blurb from the release body. Example: > [!NOTE] > This is a mainline Coder release. We advise enterprise customers without a staging environment to install our [latest stable release](https://github.com/coder/coder/releases/latest) while we refine this ve
(body string)
| 283 | // > [!NOTE] |
| 284 | // > This is a mainline Coder release. We advise enterprise customers without a staging environment to install our [latest stable release](https://github.com/coder/coder/releases/latest) while we refine this version. Learn more about our [Release Schedule](https://coder.com/docs/install/releases). |
| 285 | func removeMainlineBlurb(body string) string { |
| 286 | lines := strings.Split(body, "\n") |
| 287 | |
| 288 | var newBody, clip []string |
| 289 | var found bool |
| 290 | for _, line := range lines { |
| 291 | if strings.HasPrefix(strings.TrimSpace(line), "> [!NOTE]") { |
| 292 | clip = append(clip, line) |
| 293 | found = true |
| 294 | continue |
| 295 | } |
| 296 | if found { |
| 297 | clip = append(clip, line) |
| 298 | found = strings.HasPrefix(strings.TrimSpace(line), ">") |
| 299 | continue |
| 300 | } |
| 301 | if !found && len(clip) > 0 { |
| 302 | if !strings.Contains(strings.ToLower(strings.Join(clip, "\n")), "this is a mainline coder release") { |
| 303 | newBody = append(newBody, clip...) // This is some other note, restore it. |
| 304 | } |
| 305 | clip = nil |
| 306 | } |
| 307 | newBody = append(newBody, line) |
| 308 | } |
| 309 | |
| 310 | return strings.Join(newBody, "\n") |
| 311 | } |
| 312 | |
| 313 | // autoversion automatically updates the provided channel to version in markdown |
| 314 | // files. |