mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-18 00:41:44 +00:00
feat: add useCwd option
This commit adds the useCwd uploader option to the action. Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
This commit is contained in:
parent
bbeaa14035
commit
90a6d0bb23
5 changed files with 23991 additions and 935 deletions
|
|
@ -56,6 +56,9 @@ inputs:
|
||||||
slug:
|
slug:
|
||||||
description: 'Specify the slug manually (Enterprise use)'
|
description: 'Specify the slug manually (Enterprise use)'
|
||||||
required: false
|
required: false
|
||||||
|
useCwd:
|
||||||
|
description: 'Use the current working directory instead of the git root'
|
||||||
|
required: false
|
||||||
verbose:
|
verbose:
|
||||||
description: 'Specify whether the Codecov output should be verbose'
|
description: 'Specify whether the Codecov output should be verbose'
|
||||||
required: false
|
required: false
|
||||||
|
|
|
||||||
24741
dist/index.js
vendored
24741
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
|
|
@ -69,6 +69,7 @@ test('upload args', () => {
|
||||||
'working-directory': 'src',
|
'working-directory': 'src',
|
||||||
'plugin': 'xcode',
|
'plugin': 'xcode',
|
||||||
'exclude': 'src',
|
'exclude': 'src',
|
||||||
|
'useCwd': 'true',
|
||||||
};
|
};
|
||||||
for (const env of Object.keys(envs)) {
|
for (const env of Object.keys(envs)) {
|
||||||
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
process.env['INPUT_' + env.toUpperCase()] = envs[env];
|
||||||
|
|
@ -114,6 +115,7 @@ test('upload args', () => {
|
||||||
'xcode',
|
'xcode',
|
||||||
'--exclude',
|
'--exclude',
|
||||||
'src',
|
'src',
|
||||||
|
'--useCwd',
|
||||||
];
|
];
|
||||||
|
|
||||||
expect(uploadExecArgs).toEqual(expectedArgs);
|
expect(uploadExecArgs).toEqual(expectedArgs);
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,7 @@ const buildUploadExec = () => {
|
||||||
const workingDir = core.getInput('working-directory');
|
const workingDir = core.getInput('working-directory');
|
||||||
const plugin = core.getInput('plugin');
|
const plugin = core.getInput('plugin');
|
||||||
const exclude = core.getInput('exclude');
|
const exclude = core.getInput('exclude');
|
||||||
|
const useCwd = isTrue(core.getInput('useCwd'));
|
||||||
|
|
||||||
const uploadExecArgs = [];
|
const uploadExecArgs = [];
|
||||||
const uploadCommand = 'do-upload';
|
const uploadCommand = 'do-upload';
|
||||||
|
|
@ -244,6 +245,9 @@ const buildUploadExec = () => {
|
||||||
if (exclude) {
|
if (exclude) {
|
||||||
uploadExecArgs.push('--exclude', `${exclude}`);
|
uploadExecArgs.push('--exclude', `${exclude}`);
|
||||||
}
|
}
|
||||||
|
if (useCwd) {
|
||||||
|
uploadExecArgs.push('--useCwd');
|
||||||
|
}
|
||||||
|
|
||||||
if (uploaderVersion == '') {
|
if (uploaderVersion == '') {
|
||||||
uploaderVersion = 'latest';
|
uploaderVersion = 'latest';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue