@@ -49,10 +49,6 @@ 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 ()
53
- if err != nil {
54
- log .Fatalf ("Get commit message: %s" , err )
55
- }
56
52
commitData , err := exec .Command ("git" , "show" , "-s" , "--format=%an,%ae,%ad,%cn,%ce,%cd" ).CombinedOutput ()
57
53
if err != nil {
58
54
log .Fatalf ("Get commit data: %s" , err )
@@ -63,7 +59,7 @@ func main() {
63
59
"service" : "coder" ,
64
60
"_dd.cireport_version" : "2" ,
65
61
66
- "database" : os .Getenv ("DD_DATABASE" ),
62
+ "test.traits" : fmt . Sprintf ( `{" database":"%s"}` , os .Getenv ("DD_DATABASE" ) ),
67
63
68
64
// Additional tags found in DataDog docs. See:
69
65
// https://docs.datadoghq.com/continuous_integration/setup_tests/junit_upload/#collecting-environment-configuration-metadata
@@ -82,7 +78,7 @@ func main() {
82
78
"git.commit.sha" : githubSHA ,
83
79
"git.repository_url" : fmt .Sprintf ("%s/%s.git" , githubServerURL , githubRepository ),
84
80
85
- "git.commit.message" : strings . TrimSpace ( string ( commitMessage ) ),
81
+ "git.commit.message" : os . Getenv ( "GIT_COMMIT_MESSAGE" ),
86
82
"git.commit.author.name" : commitParts [0 ],
87
83
"git.commit.author.email" : commitParts [1 ],
88
84
"git.commit.author.date" : commitParts [2 ],
@@ -174,5 +170,11 @@ func main() {
174
170
if err != nil {
175
171
log .Fatalf ("Pretty print: %s" , err )
176
172
}
177
- _ , _ = fmt .Printf ("Status code: %d\n Response: %s\n " , res .StatusCode , msg )
173
+ _ , _ = fmt .Println (string (msg ))
174
+ msg , err = json .MarshalIndent (tags , "" , "\t " )
175
+ if err != nil {
176
+ log .Fatalf ("Marshal tags: %s" , err )
177
+ }
178
+ _ , _ = fmt .Println (string (msg ))
179
+ _ , _ = fmt .Printf ("Status: %d\n " , res .StatusCode )
178
180
}
0 commit comments