File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 38
38
uses : guyarb/golang-test-annoations@v0.3.0
39
39
with :
40
40
test-results : test.json
41
+ package-name : foobar # optional, if using custom package name, github.com/owner/repo stripped from the pathname by default
41
42
` ` `
42
43
43
44
## Development of this action
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const lineReader = require('line-by-line');
3
3
4
4
try {
5
5
const testResultsPath = core . getInput ( 'test-results' ) ;
6
+ const customPackageName = core . getInput ( 'package-name' ) ;
6
7
7
8
var obj = new Object ( ) ;
8
9
var lr = new lineReader ( testResultsPath ) ;
18
19
return ;
19
20
}
20
21
output = output . replace ( "\n" , "%0A" ) . replace ( "\r" , "%0D" )
21
- // Removing the github.com/owner/reponame
22
+ // Strip github.com/owner/repo package from the path by default
22
23
var packageName = currentLine . Package . split ( "/" ) . slice ( 3 ) . join ( "/" ) ;
24
+ // If custom package is provided, strip custom package name from the path
25
+ if ( customPackageName != null ) {
26
+ packageName = currentLine . Package . replace ( customPackageName + "/" , "" )
27
+ }
23
28
var newEntry = packageName + "/" + testName ;
24
29
if ( ! obj . hasOwnProperty ( newEntry ) ) {
25
30
obj [ newEntry ] = output ;
You can’t perform that action at this time.
0 commit comments