diff --git a/README.md b/README.md index d571ea7..4bd9313 100644 --- a/README.md +++ b/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 diff --git a/action.yml b/action.yml index 4175e38..f76aa2f 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/index.js b/index.js index d0de537..bf7215d 100644 --- a/index.js +++ b/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}`