Skip to content

Commit 1f9f557

Browse files
Add all args (#1245)
* fix: add all args from cli * chore(release): bump to 4.0.1
1 parent 09686fc commit 1f9f557

File tree

8 files changed

+219
-104
lines changed

8 files changed

+219
-104
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,6 @@
11
name: Workflow for Codecov Action
22
on: [push, pull_request]
33
jobs:
4-
no-deps:
5-
runs-on: ${{ matrix.os }}
6-
strategy:
7-
matrix:
8-
os: [macos-latest, windows-latest, ubuntu-latest]
9-
steps:
10-
- name: Checkout
11-
uses: actions/[email protected]
12-
- name: Upload coverage to Codecov (script)
13-
uses: ./
14-
with:
15-
files: ./coverage/script/coverage-final.json
16-
flags: script,${{ matrix.os }}
17-
name: codecov-script
18-
verbose: true
19-
token: ${{ secrets.CODECOV_TOKEN }}
20-
- name: Upload coverage to Codecov (demo)
21-
uses: ./
22-
with:
23-
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
24-
file: ./coverage/coverage-final.json
25-
flags: demo,${{ matrix.os }}
26-
name: codecov-demo
27-
verbose: true
28-
token: ${{ secrets.CODECOV_TOKEN }}
29-
- name: Upload coverage to Codecov (version)
30-
uses: ./
31-
with:
32-
files: ./coverage/calculator/coverage-final.json,./coverage/coverage-test/coverage-final.json
33-
file: ./coverage/coverage-final.json
34-
flags: version,${{ matrix.os }}
35-
name: codecov-version
36-
version: v0.2.0
37-
verbose: true
38-
token: ${{ secrets.CODECOV_TOKEN }}
394
run:
405
runs-on: ${{ matrix.os }}
416
strategy:

action.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ inputs:
55
token:
66
description: 'Repository upload token - get it from codecov.io. Required only for private repositories'
77
required: false
8-
file:
9-
description: 'Path to coverage file to upload'
10-
required: false
11-
files:
12-
description: 'Comma-separated list of files to upload'
8+
codecov_yml_path:
9+
description: 'Specify the path to the Codecov YML'
1310
required: false
1411
commit_parent:
1512
description: 'Override to specify the parent commit SHA'
1613
required: false
1714
directory:
1815
description: 'Directory to search for coverage reports.'
1916
required: false
17+
disable_search:
18+
description: 'Disable search for coverage files. This is helpful when specifying what files you want to upload with the --file option.'
19+
required: false
20+
disable_file_fixes:
21+
description: 'Disable file fixes to ignore common lines from coverage (e.g. blank lines or empty brackets)'
22+
required: false
2023
dry_run:
2124
description: "Don't upload files to Codecov"
2225
required: false
@@ -29,9 +32,21 @@ inputs:
2932
fail_ci_if_error:
3033
description: 'Specify whether or not CI build should fail if Codecov runs into an error during upload'
3134
required: false
35+
file:
36+
description: 'Path to coverage file to upload'
37+
required: false
38+
files:
39+
description: 'Comma-separated list of files to upload'
40+
required: false
3241
flags:
3342
description: 'Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)'
3443
required: false
44+
handle_no_reports_found:
45+
description: 'Raise no exceptions when no coverage reports found'
46+
required: false
47+
job_code:
48+
description: 'The job code'
49+
required: false
3550
name:
3651
description: 'User defined upload name. Visible in Codecov UI'
3752
required: false
@@ -44,6 +59,9 @@ inputs:
4459
override_build:
4560
description: 'Specify the build number'
4661
required: false
62+
override_build_url:
63+
description: 'The URL of the build where this is running'
64+
required: false
4765
override_commit:
4866
description: 'Specify the commit SHA'
4967
required: false
@@ -56,6 +74,9 @@ inputs:
5674
plugins:
5775
description: 'Comma-separated list of plugins for use during upload.'
5876
required: false
77+
report_code:
78+
description: 'The code of the report. If unsure, do not include'
79+
required: false
5980
root_dir:
6081
description: 'Used when not in git/hg project to identify project root directory'
6182
required: false
@@ -65,6 +86,9 @@ inputs:
6586
url:
6687
description: 'Specify the base url to upload (Enterprise use)'
6788
required: false
89+
use_legacy_upload_endpoint:
90+
description: 'Use the legacy upload endpoint'
91+
required: false
6892
verbose:
6993
description: 'Specify whether the Codecov output should be verbose'
7094
required: false

dist/index.js

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32266,6 +32266,7 @@ const buildCommitExec = () => {
3226632266
const overridePr = core.getInput('override_pr');
3226732267
const slug = core.getInput('slug');
3226832268
const token = core.getInput('token');
32269+
const failCi = isTrue(core.getInput('fail_ci_if_error'));
3226932270
const commitCommand = 'create-commit';
3227032271
const commitExecArgs = [];
3227132272
const commitOptions = {};
@@ -32302,12 +32303,19 @@ const buildCommitExec = () => {
3230232303
if (slug) {
3230332304
commitExecArgs.push('--slug', `${slug}`);
3230432305
}
32306+
if (failCi) {
32307+
commitExecArgs.push('-Z');
32308+
}
3230532309
return { commitExecArgs, commitOptions, commitCommand };
3230632310
};
3230732311
const buildGeneralExec = () => {
32312+
const codecovYmlPath = core.getInput('codecov_yml_path');
3230832313
const url = core.getInput('url');
3230932314
const verbose = isTrue(core.getInput('verbose'));
3231032315
const args = [];
32316+
if (codecovYmlPath) {
32317+
args.push('--codecov-yml-path', `${codecovYmlPath}`);
32318+
}
3231132319
if (url) {
3231232320
args.push('--enterprise-url', `${url}`);
3231332321
}
@@ -32318,8 +32326,10 @@ const buildGeneralExec = () => {
3231832326
};
3231932327
const buildReportExec = () => {
3232032328
const overrideCommit = core.getInput('override_commit');
32329+
const overridePr = core.getInput('override_pr');
3232132330
const slug = core.getInput('slug');
3232232331
const token = core.getInput('token');
32332+
const failCi = isTrue(core.getInput('fail_ci_if_error'));
3232332333
const reportCommand = 'create-report';
3232432334
const reportExecArgs = [];
3232532335
const reportOptions = {};
@@ -32341,33 +32351,49 @@ const buildReportExec = () => {
3234132351
`${context.eventName}` == 'pull_request_target') {
3234232352
reportExecArgs.push('-C', `${context.payload.pull_request.head.sha}`);
3234332353
}
32354+
if (overridePr) {
32355+
reportExecArgs.push('-P', `${overridePr}`);
32356+
}
32357+
else if (`${context.eventName}` == 'pull_request_target') {
32358+
reportExecArgs.push('-P', `${context.payload.number}`);
32359+
}
3234432360
if (slug) {
3234532361
reportExecArgs.push('--slug', `${slug}`);
3234632362
}
32363+
if (failCi) {
32364+
reportExecArgs.push('-Z');
32365+
}
3234732366
return { reportExecArgs, reportOptions, reportCommand };
3234832367
};
3234932368
const buildUploadExec = () => {
32350-
const envVars = core.getInput('env_vars');
32369+
const disableFileFixes = isTrue(core.getInput('disable_file_fixes'));
32370+
const disableSearch = isTrue(core.getInput('disable_search'));
3235132371
const dryRun = isTrue(core.getInput('dry_run'));
32372+
const envVars = core.getInput('env_vars');
32373+
const exclude = core.getInput('exclude');
3235232374
const failCi = isTrue(core.getInput('fail_ci_if_error'));
3235332375
const file = core.getInput('file');
3235432376
const files = core.getInput('files');
3235532377
const flags = core.getInput('flags');
32378+
const handleNoReportsFound = isTrue(core.getInput('handle_no_reports_found'));
32379+
const jobCode = core.getInput('job_code');
3235632380
const name = core.getInput('name');
3235732381
const os = core.getInput('os');
3235832382
const overrideBranch = core.getInput('override_branch');
3235932383
const overrideBuild = core.getInput('override_build');
32384+
const overrideBuildUrl = core.getInput('override_build_url');
3236032385
const overrideCommit = core.getInput('override_commit');
3236132386
const overridePr = core.getInput('override_pr');
32387+
const plugin = core.getInput('plugin');
3236232388
const plugins = core.getInput('plugins');
32389+
const reportCode = core.getInput('report_code');
3236332390
const rootDir = core.getInput('root_dir');
3236432391
const searchDir = core.getInput('directory');
3236532392
const slug = core.getInput('slug');
3236632393
const token = core.getInput('token');
3236732394
let uploaderVersion = core.getInput('version');
32395+
const useLegacyUploadEndpoint = isTrue(core.getInput('use_legacy_upload_endpoint'));
3236832396
const workingDir = core.getInput('working-directory');
32369-
const plugin = core.getInput('plugin');
32370-
const exclude = core.getInput('exclude');
3237132397
const uploadExecArgs = [];
3237232398
const uploadCommand = 'do-upload';
3237332399
const uploadOptions = {};
@@ -32387,18 +32413,24 @@ const buildUploadExec = () => {
3238732413
envVarsArg.push(envVarClean);
3238832414
}
3238932415
}
32390-
if (name) {
32391-
uploadExecArgs.push('-n', `${name}`);
32392-
}
3239332416
if (token) {
3239432417
uploadOptions.env.CODECOV_TOKEN = token;
3239532418
}
32419+
if (disableFileFixes) {
32420+
uploadExecArgs.push('--disable-file-fixes');
32421+
}
32422+
if (disableSearch) {
32423+
uploadExecArgs.push('--disable-search');
32424+
}
3239632425
if (dryRun) {
3239732426
uploadExecArgs.push('-d');
3239832427
}
3239932428
if (envVarsArg.length) {
3240032429
uploadExecArgs.push('-e', envVarsArg.join(','));
3240132430
}
32431+
if (exclude) {
32432+
uploadExecArgs.push('--exclude', `${exclude}`);
32433+
}
3240232434
if (failCi) {
3240332435
uploadExecArgs.push('-Z');
3240432436
}
@@ -32415,12 +32447,24 @@ const buildUploadExec = () => {
3241532447
uploadExecArgs.push('-F', `${f}`);
3241632448
});
3241732449
}
32450+
if (handleNoReportsFound) {
32451+
uploadExecArgs.push('--handle-no-reports-found');
32452+
}
32453+
if (jobCode) {
32454+
uploadExecArgs.push('--job-code', `${jobCode}`);
32455+
}
32456+
if (name) {
32457+
uploadExecArgs.push('-n', `${name}`);
32458+
}
3241832459
if (overrideBranch) {
3241932460
uploadExecArgs.push('-B', `${overrideBranch}`);
3242032461
}
3242132462
if (overrideBuild) {
3242232463
uploadExecArgs.push('-b', `${overrideBuild}`);
3242332464
}
32465+
if (overrideBuildUrl) {
32466+
uploadExecArgs.push('--build-url', `${overrideBuildUrl}`);
32467+
}
3242432468
if (overrideCommit) {
3242532469
uploadExecArgs.push('-C', `${overrideCommit}`);
3242632470
}
@@ -32434,11 +32478,17 @@ const buildUploadExec = () => {
3243432478
else if (`${context.eventName}` == 'pull_request_target') {
3243532479
uploadExecArgs.push('-P', `${context.payload.number}`);
3243632480
}
32481+
if (plugin) {
32482+
uploadExecArgs.push('--plugin', `${plugin}`);
32483+
}
3243732484
if (plugins) {
3243832485
plugins.split(',').map((p) => p.trim()).forEach((p) => {
3243932486
uploadExecArgs.push('--plugin', `${p}`);
3244032487
});
3244132488
}
32489+
if (reportCode) {
32490+
uploadExecArgs.push('--report-code', `${reportCode}`);
32491+
}
3244232492
if (rootDir) {
3244332493
uploadExecArgs.push('--network-root-folder', `${rootDir}`);
3244432494
}
@@ -32451,15 +32501,12 @@ const buildUploadExec = () => {
3245132501
if (workingDir) {
3245232502
uploadOptions.cwd = workingDir;
3245332503
}
32454-
if (plugin) {
32455-
uploadExecArgs.push('--plugin', `${plugin}`);
32456-
}
32457-
if (exclude) {
32458-
uploadExecArgs.push('--exclude', `${exclude}`);
32459-
}
3246032504
if (uploaderVersion == '') {
3246132505
uploaderVersion = 'latest';
3246232506
}
32507+
if (useLegacyUploadEndpoint) {
32508+
uploadExecArgs.push('--legacy');
32509+
}
3246332510
return {
3246432511
uploadExecArgs,
3246532512
uploadOptions,

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codecov-action",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Upload coverage reports to Codecov from GitHub Actions",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)