@@ -49,7 +49,7 @@ func main() {
49
49
pipelineURL += fmt .Sprintf ("/attempts/%s" , os .Getenv ("GITHUB_RUN_ATTEMPT" ))
50
50
}
51
51
52
- commitMessage , err := exec .Command ("git" , "show " , "-s " , "--format= %s" ).CombinedOutput ()
52
+ commitMessage , err := exec .Command ("git" , "log " , "-1 " , "--pretty=format: %s" ).CombinedOutput ()
53
53
if err != nil {
54
54
log .Fatalf ("Get commit message: %s" , err )
55
55
}
@@ -63,7 +63,7 @@ func main() {
63
63
"service" : "coder" ,
64
64
"_dd.cireport_version" : "2" ,
65
65
66
- "database" : os .Getenv ("DD_DATABASE" ),
66
+ "test.traits" : fmt . Sprintf ( `{" database":"%s"}` , os .Getenv ("DD_DATABASE" ) ),
67
67
68
68
// Additional tags found in DataDog docs. See:
69
69
// https://docs.datadoghq.com/continuous_integration/setup_tests/junit_upload/#collecting-environment-configuration-metadata
@@ -82,7 +82,7 @@ func main() {
82
82
"git.commit.sha" : githubSHA ,
83
83
"git.repository_url" : fmt .Sprintf ("%s/%s.git" , githubServerURL , githubRepository ),
84
84
85
- "git.commit.message" : strings . TrimSpace ( string (commitMessage ) ),
85
+ "git.commit.message" : string (commitMessage ),
86
86
"git.commit.author.name" : commitParts [0 ],
87
87
"git.commit.author.email" : commitParts [1 ],
88
88
"git.commit.author.date" : commitParts [2 ],
@@ -174,5 +174,11 @@ func main() {
174
174
if err != nil {
175
175
log .Fatalf ("Pretty print: %s" , err )
176
176
}
177
- _ , _ = fmt .Printf ("Status code: %d\n Response: %s\n " , res .StatusCode , msg )
177
+ _ , _ = fmt .Println (string (msg ))
178
+ msg , err = json .MarshalIndent (tags , "" , "\t " )
179
+ if err != nil {
180
+ log .Fatalf ("Marshal tags: %s" , err )
181
+ }
182
+ _ , _ = fmt .Println (string (msg ))
183
+ _ , _ = fmt .Printf ("Status: %d\n " , res .StatusCode )
178
184
}
0 commit comments