mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-23 20:27:02 +08:00
not adding -n if empty to do-upload command (#1085)
This commit is contained in:
12
dist/index.js
vendored
12
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -35,10 +35,7 @@ test('general args', () => {
|
|||||||
|
|
||||||
|
|
||||||
test('upload args using context', () => {
|
test('upload args using context', () => {
|
||||||
const expectedArgs = [
|
const expectedArgs = [];
|
||||||
'-n',
|
|
||||||
'',
|
|
||||||
];
|
|
||||||
const {uploadExecArgs, uploadCommand} = buildUploadExec();
|
const {uploadExecArgs, uploadCommand} = buildUploadExec();
|
||||||
if (context.eventName == 'pull_request') {
|
if (context.eventName == 'pull_request') {
|
||||||
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
expectedArgs.push('-C', `${context.payload.pull_request.head.sha}`);
|
||||||
|
|||||||
@@ -149,10 +149,6 @@ const buildUploadExec = () => {
|
|||||||
const exclude = core.getInput('exclude');
|
const exclude = core.getInput('exclude');
|
||||||
|
|
||||||
const uploadExecArgs = [];
|
const uploadExecArgs = [];
|
||||||
uploadExecArgs.push(
|
|
||||||
'-n',
|
|
||||||
`${name}`,
|
|
||||||
);
|
|
||||||
const uploadCommand = 'do-upload';
|
const uploadCommand = 'do-upload';
|
||||||
const uploadOptions:any = {};
|
const uploadOptions:any = {};
|
||||||
uploadOptions.env = Object.assign(process.env, {
|
uploadOptions.env = Object.assign(process.env, {
|
||||||
@@ -172,7 +168,12 @@ const buildUploadExec = () => {
|
|||||||
envVarsArg.push(envVarClean);
|
envVarsArg.push(envVarClean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (name) {
|
||||||
|
uploadExecArgs.push(
|
||||||
|
'-n',
|
||||||
|
`${name}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
if (token) {
|
if (token) {
|
||||||
uploadOptions.env.CODECOV_TOKEN = token;
|
uploadOptions.env.CODECOV_TOKEN = token;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user