Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle trailing commas #1470

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32568,7 +32568,9 @@ const buildUploadExec = () => buildExec_awaiter(void 0, void 0, void 0, function
}
if (files) {
files.split(',').map((f) => f.trim()).forEach((f) => {
uploadExecArgs.push('-f', `${f}`);
if (f.length > 0) { // this handles trailing commas
uploadExecArgs.push('-f', `${f}`);
}
});
}
if (flags) {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/buildExec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ test('upload args', async () => {
'exclude': 'node_modules/',
'fail_ci_if_error': 'true',
'file': 'coverage.xml',
'files': 'dir1/coverage.xml,dir2/coverage.xml',
'files': 'dir1/coverage.xml,dir2/coverage.xml,',
'flags': 'test,test2',
'git_service': 'github_enterprise',
'handle_no_reports_found': 'true',
Expand Down
4 changes: 3 additions & 1 deletion src/buildExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ const buildUploadExec = async (): Promise<{
}
if (files) {
files.split(',').map((f) => f.trim()).forEach((f) => {
uploadExecArgs.push('-f', `${f}`);
if (f.length > 0) { // this handles trailing commas
uploadExecArgs.push('-f', `${f}`);
}
});
}
if (flags) {
Expand Down
Loading