codecov-node icon indicating copy to clipboard operation
codecov-node copied to clipboard

Upload not reading token from `.codecov.yml` nor `codecov.yml`

Open yangshun opened this issue 9 years ago • 6 comments

When I tried running $ codecov in the root directory of the repository, I'm getting the following output:

  _____          _  
 / ____|        | |  
| |     ___   __| | ___  ___ _____   __  
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /  
| |___| (_) | (_| |  __/ (_| (_) \ V /  
 \_____\___/ \__,_|\___|\___\___/ \_/  
                                v2.2.0
YAML .codecov.yml
==> Detecting CI Provider
    No CI Detected. Using git/mercurial
==> Configuration: 
    Endpoint: https://codecov.io
{ commit: 'eb22cc3fcb7c17222366ed11b57ea5a1049fd7c2',
  branch: 'master',
  package: 'node-v2.2.0' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
    $ find . -type f -name '*.gcno'  -exec gcov  {} +
==> Scanning for reports
    + ./foo/coverage/lcov.info
==> Uploading reports
    HTTP 400
Please provide the repository token to upload reports via `-t :repository-token`

even though there's a token in my .codecov.yml. I did verify that the .codecov.yml is valid by running:

$ cat .codecov.yml | curl --data-binary @- https://codecov.io/validate

Upon digging into the code, I see these lines detect the codecov.yml file but don't do anything with it.

I can put the token in process.env.CODECOV_TOKEN but I'm just wondering if it's a mistake or by design that reading the token from the codecov.yml file isn't supported.

yangshun avatar Jun 07 '17 07:06 yangshun

👍 - same issue for me, forcing us to continue using token flag to run cmd

this is for private repo if it makes a difference.

lfender6445 avatar Feb 10 '18 17:02 lfender6445

If the yaml is not detected at .codecov.yml you may need to change the path to codecov.yml. Our detection occurs through the git ls-files in our backend.

If you would like us to manually change the location of the yaml please contact us in the in-app chat support with owner/repo @ .codecov.yml to adjust it.

Thank you, Steve

stevepeak avatar Feb 13 '18 09:02 stevepeak

Please do put the token in process.env.CODECOV_TOKEN 👍

stevepeak avatar Feb 13 '18 09:02 stevepeak

I must put my upload token in the git repo?

jacobbogers avatar Feb 23 '18 17:02 jacobbogers

@jacobbogers no it doesn't need to go in the git repo. It can just be in your CI.

eddiemoore avatar Feb 26 '18 14:02 eddiemoore

i submitted a PR for supporting either one of the yaml files: https://github.com/codecov/codecov-node/pull/108

hellatan avatar Aug 16 '18 20:08 hellatan