Skip to content

Commit feaf700

Browse files
fix: handle trailing commas (#1470)
Signed-off-by: joseph-sentry <[email protected]>
1 parent 7b6a727 commit feaf700

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

dist/index.js

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/buildExec.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ test('upload args', async () => {
7575
'exclude': 'node_modules/',
7676
'fail_ci_if_error': 'true',
7777
'file': 'coverage.xml',
78-
'files': 'dir1/coverage.xml,dir2/coverage.xml',
78+
'files': 'dir1/coverage.xml,dir2/coverage.xml,',
7979
'flags': 'test,test2',
8080
'git_service': 'github_enterprise',
8181
'handle_no_reports_found': 'true',

src/buildExec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ const buildUploadExec = async (): Promise<{
311311
}
312312
if (files) {
313313
files.split(',').map((f) => f.trim()).forEach((f) => {
314-
uploadExecArgs.push('-f', `${f}`);
314+
if (f.length > 0) { // this handles trailing commas
315+
uploadExecArgs.push('-f', `${f}`);
316+
}
315317
});
316318
}
317319
if (flags) {

0 commit comments

Comments
 (0)