mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-09 20:47:26 +00:00
fix: add set safe directory
This commit is contained in:
parent
036b81c4b4
commit
eb61afa559
6 changed files with 22 additions and 8 deletions
|
|
@ -14,11 +14,14 @@ inputs:
|
|||
directory:
|
||||
description: 'Directory to search for coverage reports.'
|
||||
required: false
|
||||
disable_file_fixes:
|
||||
description: 'Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets)'
|
||||
required: false
|
||||
disable_search:
|
||||
description: 'Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option.'
|
||||
required: false
|
||||
disable_file_fixes:
|
||||
description: 'Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets)'
|
||||
disable_safe_directory:
|
||||
description: 'Disable setting safe directory. Set to true to disable.'
|
||||
required: false
|
||||
dry_run:
|
||||
description: "Don't upload files to Codecov"
|
||||
|
|
|
|||
8
dist/index.js
vendored
8
dist/index.js
vendored
|
|
@ -32379,6 +32379,7 @@ const buildReportExec = () => {
|
|||
};
|
||||
const buildUploadExec = () => {
|
||||
const disableFileFixes = isTrue(core.getInput('disable_file_fixes'));
|
||||
const disableSafeDirectory = isTrue(core.getInput('diable_safe_directory'));
|
||||
const disableSearch = isTrue(core.getInput('disable_search'));
|
||||
const dryRun = isTrue(core.getInput('dry_run'));
|
||||
const envVars = core.getInput('env_vars');
|
||||
|
|
@ -32524,6 +32525,7 @@ const buildUploadExec = () => {
|
|||
return {
|
||||
uploadExecArgs,
|
||||
uploadOptions,
|
||||
disableSafeDirectory,
|
||||
failCi,
|
||||
os,
|
||||
uploaderVersion,
|
||||
|
|
@ -32754,7 +32756,7 @@ let failCi;
|
|||
try {
|
||||
const { commitExecArgs, commitOptions, commitCommand } = buildCommitExec();
|
||||
const { reportExecArgs, reportOptions, reportCommand } = buildReportExec();
|
||||
const { uploadExecArgs, uploadOptions, failCi, os, uploaderVersion, uploadCommand, } = buildUploadExec();
|
||||
const { uploadExecArgs, uploadOptions, disableSafeDirectory, failCi, os, uploaderVersion, uploadCommand, } = buildUploadExec();
|
||||
const { args, verbose } = buildGeneralExec();
|
||||
const platform = getPlatform(os);
|
||||
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
||||
|
|
@ -32770,7 +32772,9 @@ try {
|
|||
yield validate(filename, platform, uploaderVersion, verbose, failCi);
|
||||
yield version(platform, uploaderVersion);
|
||||
yield external_fs_.chmodSync(filename, '777');
|
||||
yield setSafeDirectory();
|
||||
if (!disableSafeDirectory) {
|
||||
yield setSafeDirectory();
|
||||
}
|
||||
const unlink = () => {
|
||||
external_fs_.unlink(filename, (err) => {
|
||||
if (err) {
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -68,6 +68,7 @@ test('upload args', () => {
|
|||
'file': 'coverage.xml',
|
||||
'files': 'dir1/coverage.xml,dir2/coverage.xml',
|
||||
'flags': 'test,test2',
|
||||
'git_service': 'github_enterprise',
|
||||
'handle_no_reports_found': 'true',
|
||||
'job_code': '32',
|
||||
'name': 'codecov',
|
||||
|
|
@ -114,7 +115,7 @@ test('upload args', () => {
|
|||
'-F',
|
||||
'test2',
|
||||
'--git-service',
|
||||
'github',
|
||||
'github_enterprise',
|
||||
'--handle-no-reports-found',
|
||||
'--job-code',
|
||||
'32',
|
||||
|
|
@ -157,6 +158,7 @@ test('upload args', () => {
|
|||
|
||||
test('report args', () => {
|
||||
const envs = {
|
||||
git_service: 'github_enterprise',
|
||||
override_commit: '9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||
override_pr: 'fakePR',
|
||||
slug: 'fakeOwner/fakeRepo',
|
||||
|
|
@ -171,7 +173,7 @@ test('report args', () => {
|
|||
|
||||
const expectedArgs = [
|
||||
'--git-service',
|
||||
'github',
|
||||
'github_enterprise',
|
||||
'-C',
|
||||
'9caabca5474b49de74ef5667deabaf74cdacc244',
|
||||
'-P',
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ const buildReportExec = () => {
|
|||
|
||||
const buildUploadExec = () => {
|
||||
const disableFileFixes = isTrue(core.getInput('disable_file_fixes'));
|
||||
const disableSafeDirectory = isTrue(core.getInput('diable_safe_directory'));
|
||||
const disableSearch = isTrue(core.getInput('disable_search'));
|
||||
const dryRun = isTrue(core.getInput('dry_run'));
|
||||
const envVars = core.getInput('env_vars');
|
||||
|
|
@ -312,6 +313,7 @@ const buildUploadExec = () => {
|
|||
return {
|
||||
uploadExecArgs,
|
||||
uploadOptions,
|
||||
disableSafeDirectory,
|
||||
failCi,
|
||||
os,
|
||||
uploaderVersion,
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ try {
|
|||
const {
|
||||
uploadExecArgs,
|
||||
uploadOptions,
|
||||
disableSafeDirectory,
|
||||
failCi,
|
||||
os,
|
||||
uploaderVersion,
|
||||
|
|
@ -56,7 +57,9 @@ try {
|
|||
await verify(filename, platform, uploaderVersion, verbose, failCi);
|
||||
await versionInfo(platform, uploaderVersion);
|
||||
await fs.chmodSync(filename, '777');
|
||||
await setSafeDirectory();
|
||||
if (!disableSafeDirectory) {
|
||||
await setSafeDirectory();
|
||||
}
|
||||
|
||||
const unlink = () => {
|
||||
fs.unlink(filename, (err) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue