1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-11-06 09:09:19 +02:00

doc: fix generation of empty stages (#3354)

This commit is contained in:
Oliver Nocon
2021-12-13 13:05:07 +01:00
committed by GitHub
parent e727601ea4
commit cf8dad1edd

View File

@@ -349,12 +349,12 @@ func createPipelineStageDocumentation(stageRunConfig *config.RunConfigV1, stageT
for _, step := range stage.Steps {
stageDoc += fmt.Sprintf("| [%v](%v/%v.md) | %v |\n", step.Name, relativeStepsPath, step.Name, getStepConditionDetails(step))
}
}
stageFilePath := filepath.Join(stageTargetPath, fmt.Sprintf("%v.md", stage.Name))
fmt.Println("writing file", stageFilePath)
if err := utils.FileWrite(stageFilePath, []byte(stageDoc), 0666); err != nil {
return fmt.Errorf("failed to write stage file '%v': %w", stageFilePath, err)
}
stageFilePath := filepath.Join(stageTargetPath, fmt.Sprintf("%v.md", stage.Name))
fmt.Println("writing file", stageFilePath)
if err := utils.FileWrite(stageFilePath, []byte(stageDoc), 0666); err != nil {
return fmt.Errorf("failed to write stage file '%v': %w", stageFilePath, err)
}
}
return nil