not adding -n if empty to do-upload command (#1085)

This commit is contained in:
Dana Yaish
2023-09-13 19:20:12 +03:00
committed by GitHub
parent 0016507ac7
commit 845c445181
4 changed files with 17 additions and 13 deletions

12
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -35,10 +35,7 @@ test('general args', () => {
test('upload args using context', () => {
const expectedArgs = [
'-n',
'',
];
const expectedArgs = [];
const {uploadExecArgs, uploadCommand} = buildUploadExec();
if (context.eventName == 'pull_request') {
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);

View File

@@ -149,10 +149,6 @@ const buildUploadExec = () => {
const exclude = core.getInput('exclude');
const uploadExecArgs = [];
uploadExecArgs.push(
'-n',
`${name}`,
);
const uploadCommand = 'do-upload';
const uploadOptions:any = {};
uploadOptions.env = Object.assign(process.env, {
@@ -172,7 +168,12 @@ const buildUploadExec = () => {
envVarsArg.push(envVarClean);
}
}
if (name) {
uploadExecArgs.push(
'-n',
`${name}`,
);
}
if (token) {
uploadOptions.env.CODECOV_TOKEN = token;
}