Skip to content

Commit 98d28a8

Browse files
committed
Changes output destination for pipeline generated reports
1 parent 4b4d467 commit 98d28a8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cmd/gen-pipeline-report.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ var genPipelineReportCmd = &cobra.Command{
4545

4646
var dir string
4747

48-
if len(args) == 0 {
48+
pipelineID, found := os.LookupEnv("SEMAPHORE_PIPELINE_ID")
49+
if !found {
50+
logger.Error("SEMAPHORE_PIPELINE_ID env is missing")
51+
return
52+
}
4953

50-
pipelineID, found := os.LookupEnv("SEMAPHORE_PIPELINE_ID")
51-
if !found {
52-
logger.Error("SEMAPHORE_PIPELINE_ID env is missing")
53-
return
54-
}
54+
if len(args) == 0 {
5555
dir, err = ioutil.TempDir("/tmp", "test-results")
5656
if err != nil {
5757
logger.Error("Creating temporary directory failed %v", err)
@@ -82,7 +82,7 @@ var genPipelineReportCmd = &cobra.Command{
8282
return
8383
}
8484

85-
_, err = cli.PushArtifacts("workflow", fileName, path.Join("test-results", "junit.json"), cmd)
85+
_, err = cli.PushArtifacts("workflow", fileName, path.Join("test-results", pipelineID+".json"), cmd)
8686
if err != nil {
8787
return
8888
}

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
var cfgFile string
3232

33-
var versionString = "0.4.6"
33+
var versionString = "0.4.7"
3434

3535
// rootCmd represents the base command when called without any subcommands
3636
var rootCmd = &cobra.Command{

0 commit comments

Comments
 (0)