You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
feat: add commit and pipeline to GitHub reporting (#3930)
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/SAP/jenkins-library/pkg/orchestrator"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
@@ -87,6 +89,19 @@ func (v *VulnerabilityReport) ToMarkdown() ([]byte, error) {
|
||||
return caser.String(s)
|
||||
},
|
||||
}
|
||||
|
||||
// only fill with orchestrator information if orchestrator can be identified properly
|
||||
if provider, err := orchestrator.NewOrchestratorSpecificConfigProvider(); err == nil {
|
||||
// only add information if not yet provided
|
||||
if len(v.CommitID) == 0 {
|
||||
v.CommitID = provider.GetCommit()
|
||||
}
|
||||
if len(v.PipelineLink) == 0 {
|
||||
v.PipelineLink = provider.GetJobURL()
|
||||
v.PipelineName = provider.GetJobName()
|
||||
}
|
||||
}
|
||||
|
||||
md := []byte{}
|
||||
tmpl, err := template.New("report").Funcs(funcMap).Parse(vulnerabilityMdTemplate)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user