MCPcopy Index your code
hub / github.com/coder/coder / removeMainlineBlurb

Function removeMainlineBlurb

scripts/release/main.go:285–311  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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).
285func 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.

Callers 2

Test_removeMainlineBlurbFunction · 0.85

Calls 1

ContainsMethod · 0.45

Tested by 1

Test_removeMainlineBlurbFunction · 0.68