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:
joseph-sentry 2023-12-29 15:53:12 -05:00
parent bbeaa14035
commit 90a6d0bb23
No known key found for this signature in database
5 changed files with 23991 additions and 935 deletions

View file

@ -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

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

@ -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);

View file

@ -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';