mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-09 20:47:26 +00:00
add 'config' input to specify path to codecov.yml
This commit is contained in:
parent
a3a6becb2c
commit
9759b41f87
3 changed files with 17 additions and 4 deletions
11
README.md
11
README.md
|
|
@ -23,6 +23,7 @@ steps:
|
|||
flags: unittests # optional
|
||||
name: codecov-umbrella # optional
|
||||
fail_ci_if_error: true # optional (default = false)
|
||||
config: ./path/to/codecov.yml # optional
|
||||
```
|
||||
>**Note**: This assumes that you've set your Codecov token inside *Settings > Secrets* as `CODECOV_TOKEN`. If not, you can [get an upload token](https://docs.codecov.io/docs/frequently-asked-questions#section-where-is-the-repository-upload-token-found-) for your specific repo on [codecov.io](https://www.codecov.io). Keep in mind that secrets are *not* available to forks of repositories.
|
||||
|
||||
|
|
@ -35,10 +36,11 @@ Codecov's Action currently supports five inputs from the user: `token`, `file`,
|
|||
| Input | Description | Usage |
|
||||
| :---: | :---: | :---: |
|
||||
| `token` | Used to authorize coverage report uploads | *Required for private repos* |
|
||||
| `file` | Path to the coverage report(s) | Optional
|
||||
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional
|
||||
| `name` | Custom defined name for the upload | Optional
|
||||
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional
|
||||
| `file` | Path to the coverage report(s) | Optional |
|
||||
| `flags` | Flag the upload to group coverage metrics (unittests, uitests, etc.). Multiple flags are separated by a comma (ui,chrome) | Optional |
|
||||
| `name` | Custom defined name for the upload | Optional |
|
||||
| `fail_ci_if_error` | Specify if CI pipeline should fail when Codecov runs into errors during upload. *Defaults to **false*** | Optional |
|
||||
| `config` | Path to codecov.yml config file | Optional |
|
||||
|
||||
### Example `workflow.yml` with Codecov Action
|
||||
|
||||
|
|
@ -70,6 +72,7 @@ jobs:
|
|||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: true
|
||||
config: ./path/to/codecov.yml
|
||||
```
|
||||
## Contributing
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ inputs:
|
|||
fail_ci_if_error:
|
||||
description: 'Specify whether or not CI build should fail if Codecov runs into an error during upload'
|
||||
required: false
|
||||
config:
|
||||
description: 'Path to codecov.yml config file'
|
||||
required: false
|
||||
branding:
|
||||
color: 'red'
|
||||
icon: 'umbrella'
|
||||
|
|
|
|||
7
index.js
7
index.js
|
|
@ -9,6 +9,7 @@ try {
|
|||
const token = core.getInput("token");
|
||||
const flags = core.getInput("flags");
|
||||
const file = core.getInput("file");
|
||||
const config = core.getInput("config");
|
||||
fail_ci = core.getInput("fail_ci_if_error").toLowerCase();
|
||||
|
||||
if (
|
||||
|
|
@ -69,6 +70,12 @@ try {
|
|||
);
|
||||
}
|
||||
|
||||
if (config) {
|
||||
execArgs.push(
|
||||
"-y", `${config}`
|
||||
);
|
||||
}
|
||||
|
||||
execArgs.push(
|
||||
"-n", `${name}`,
|
||||
"-F", `${flags}`
|
||||
|
|
|
|||
Loading…
Reference in a new issue