Skip to content

Commit 3f5200e

Browse files
authored
Merge pull request #3583 from saschagrunert/markdown-help
schedule-builder: Add markdown help
2 parents 2fcf8f0 + 78ae01c commit 3f5200e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/schedule-builder/cmd/markdown.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ func processFile(fileName string, vars interface{}) string {
179179
const (
180180
refDate = "2006-01-02"
181181
refDateMonthly = "January 2006"
182+
markdownHelp = `# Use "schedule-builder" to maintain this file:
183+
# https://github.com/kubernetes/release/tree/master/cmd/schedule-builder
184+
# For example by running:
185+
# schedule-builder -uc data/releases/schedule.yaml -e data/releases/eol.yaml
186+
---
187+
`
182188
)
183189

184190
func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches EolBranches, filePath, eolFilePath string) error {
@@ -311,6 +317,7 @@ func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches
311317
if err != nil {
312318
return fmt.Errorf("marshal schedule YAML: %w", err)
313319
}
320+
yamlBytes = append([]byte(markdownHelp), yamlBytes...)
314321

315322
//nolint:gocritic,gosec
316323
if err := os.WriteFile(filePath, yamlBytes, 0o644); err != nil {
@@ -324,6 +331,7 @@ func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches
324331
if err != nil {
325332
return fmt.Errorf("marshal end of life YAML: %w", err)
326333
}
334+
yamlBytes = append([]byte(markdownHelp), yamlBytes...)
327335

328336
//nolint:gocritic,gosec
329337
if err := os.WriteFile(eolFilePath, yamlBytes, 0o644); err != nil {

0 commit comments

Comments
 (0)