Skip to content

Commit

Permalink
Merge pull request #3583 from saschagrunert/markdown-help
Browse files Browse the repository at this point in the history
schedule-builder: Add markdown help
  • Loading branch information
k8s-ci-robot committed Apr 23, 2024
2 parents 2fcf8f0 + 78ae01c commit 3f5200e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/schedule-builder/cmd/markdown.go
Expand Up @@ -179,6 +179,12 @@ func processFile(fileName string, vars interface{}) string {
const (
refDate = "2006-01-02"
refDateMonthly = "January 2006"
markdownHelp = `# Use "schedule-builder" to maintain this file:
# https://github.com/kubernetes/release/tree/master/cmd/schedule-builder
# For example by running:
# schedule-builder -uc data/releases/schedule.yaml -e data/releases/eol.yaml
---
`
)

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

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

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

0 comments on commit 3f5200e

Please sign in to comment.